1 | <?php |
||
17 | trait InputTrait |
||
18 | { |
||
19 | /** |
||
20 | * Return select input object |
||
21 | * |
||
22 | * @param string $name |
||
23 | * @return WebDriver\Select |
||
24 | */ |
||
25 | protected function getSelectInput($name) |
||
29 | |||
30 | /** |
||
31 | * @param string $name |
||
32 | * @return WebDriver\Select |
||
33 | * @deprecated use getSelectInput() instead |
||
34 | * @todo remove, deprecated |
||
35 | */ |
||
36 | protected function getSelect($name) |
||
40 | |||
41 | /** |
||
42 | * Enters the input value |
||
43 | * |
||
44 | * @param string|WebDriverElement $name |
||
45 | * @param string $value |
||
46 | * @param callable|false|null $callback |
||
47 | * @return $this |
||
48 | */ |
||
49 | protected function enterInput($name, $value, $callback = null) |
||
73 | |||
74 | /** |
||
75 | * Submit the input value |
||
76 | * |
||
77 | * @param string|WebDriverElement $name |
||
78 | * @param string $value |
||
79 | * @return $this |
||
80 | */ |
||
81 | protected function submitInput($name, $value) |
||
89 | |||
90 | /** |
||
91 | * Assert that input value is same than expected |
||
92 | * |
||
93 | * @param string|WebDriverElement|WebDriver\ElementInterface $name |
||
94 | * @param string $expectedValue |
||
95 | * @param callable $callback |
||
96 | * @return $this |
||
97 | */ |
||
98 | public function assertInput($name, $expectedValue, callable $callback = null) |
||
105 | } |
||
106 |
This check looks for methods that are used by a trait but not required by it.
To illustrate, let’s look at the following code example
The trait
Idable
provides a methodequalsId
that in turn relies on the methodgetId()
. If this method does not exist on a class mixing in this trait, the method will fail.Adding the
getId()
as an abstract method to the trait will make sure it is available.