1<?php
2
3namespace Facebook\WebDriver;
4
5use Facebook\WebDriver\Exception\UnsupportedOperationException;
6use Facebook\WebDriver\Exception\WebDriverException;
7
8/**
9 * Provides helper methods for radio buttons.
10 */
11class WebDriverRadios extends AbstractWebDriverCheckboxOrRadio
12{
13    public function __construct(WebDriverElement $element)
14    {
15        parent::__construct($element);
16
17        $this->type = $element->getAttribute('type');
18        if ($this->type !== 'radio') {
19            throw new WebDriverException('The input must be of type "radio".');
20        }
21    }
22
23    public function isMultiple()
24    {
25        return false;
26    }
27
28    public function deselectAll()
29    {
30        throw new UnsupportedOperationException('You cannot deselect radio buttons');
31    }
32
33    public function deselectByIndex($index)
34    {
35        throw new UnsupportedOperationException('You cannot deselect radio buttons');
36    }
37
38    public function deselectByValue($value)
39    {
40        throw new UnsupportedOperationException('You cannot deselect radio buttons');
41    }
42
43    public function deselectByVisibleText($text)
44    {
45        throw new UnsupportedOperationException('You cannot deselect radio buttons');
46    }
47
48    public function deselectByVisiblePartialText($text)
49    {
50        throw new UnsupportedOperationException('You cannot deselect radio buttons');
51    }
52}
53