1 | <?php |
||
16 | class RawPageContext extends RawDrupalContext |
||
17 | { |
||
18 | /** |
||
19 | * @var NodeElement |
||
20 | */ |
||
21 | private static $workingElement; |
||
22 | |||
23 | /** |
||
24 | * @return NodeElement |
||
25 | */ |
||
26 | public function getWorkingElement() |
||
34 | |||
35 | /** |
||
36 | * @param NodeElement $element |
||
37 | */ |
||
38 | public function setWorkingElement(NodeElement $element) |
||
42 | |||
43 | public function unsetWorkingElement() |
||
47 | |||
48 | /** |
||
49 | * @param string $selector |
||
50 | * |
||
51 | * @return NodeElement |
||
52 | */ |
||
53 | public function findByCss($selector) |
||
58 | |||
59 | /** |
||
60 | * @param string $selector |
||
61 | * |
||
62 | * @return NodeElement|null |
||
63 | */ |
||
64 | public function findField($selector) |
||
83 | |||
84 | /** |
||
85 | * @param string $selector |
||
86 | * |
||
87 | * @return NodeElement |
||
88 | */ |
||
89 | public function findButton($selector) |
||
97 | |||
98 | /** |
||
99 | * @param string $text |
||
100 | * |
||
101 | * @return NodeElement|null |
||
102 | */ |
||
103 | public function findByText($text) |
||
107 | |||
108 | /** |
||
109 | * @param string $locator |
||
110 | * Element locator. Can be inaccurate text, inaccurate field label, CSS selector or region name. |
||
111 | * |
||
112 | * @throws NoSuchElement |
||
113 | * |
||
114 | * @return NodeElement |
||
115 | */ |
||
116 | public function findElement($locator) |
||
123 | |||
124 | /** |
||
125 | * Find all field labels by text. |
||
126 | * |
||
127 | * @param string $text |
||
128 | * Label text. |
||
129 | * |
||
130 | * @return NodeElement[] |
||
131 | */ |
||
132 | public function findLabels($text) |
||
143 | |||
144 | /** |
||
145 | * @return NodeElement |
||
146 | */ |
||
147 | public function getBodyElement() |
||
151 | |||
152 | /** |
||
153 | * @param string $selector |
||
154 | * Element selector. |
||
155 | * @param mixed $element |
||
156 | * Existing element or null. |
||
157 | * |
||
158 | * @throws NoSuchElement |
||
159 | */ |
||
160 | public function throwNoSuchElementException($selector, $element) |
||
166 | |||
167 | /** |
||
168 | * @param string $locator |
||
169 | * @param string $selector |
||
170 | * |
||
171 | * @throws \RuntimeException |
||
172 | * @throws NoSuchElement |
||
173 | * |
||
174 | * @return NodeElement |
||
175 | */ |
||
176 | public function element($locator, $selector) |
||
196 | } |
||
197 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: