1 | <?php |
||
13 | abstract class Driver { |
||
14 | |||
15 | public $page = NULL; |
||
16 | |||
17 | public $name = NULL; |
||
18 | |||
19 | public $default_wait_time = 3000; |
||
20 | |||
21 | /** |
||
22 | * Clear session stuff / cookies created by the current page |
||
23 | * @return $this |
||
24 | */ |
||
25 | 1 | public function clear() |
|
29 | |||
30 | /** |
||
31 | * Return an array of HTML fragments that match a given XPath query |
||
32 | * @param string $id |
||
33 | * @return array |
||
34 | */ |
||
35 | 1 | public function all($id) |
|
39 | |||
40 | /** |
||
41 | * Return an the id of the html elemenet |
||
42 | * @throws Exception_Notfound If element not found |
||
43 | * @param string $id |
||
44 | * @return array |
||
45 | */ |
||
46 | 1 | public function find($id) |
|
50 | |||
51 | /** |
||
52 | * Return the HTML content of the current page or set it manually |
||
53 | * @param string $content |
||
54 | * @return string |
||
55 | */ |
||
56 | 1 | public function content($content = NULL) |
|
60 | |||
61 | /** |
||
62 | * Return the tag name of a HTML fragemnt, specified by id |
||
63 | * If multiple tags match - return the first one. |
||
64 | * @param string $id |
||
65 | * @return string |
||
66 | */ |
||
67 | 1 | public function tag_name($id) |
|
71 | |||
72 | /** |
||
73 | * Return the tag attribute of an HTML fragment, spesified by id |
||
74 | * If multiple tags match - return the first one. |
||
75 | * @param string $id |
||
76 | * @param string $name |
||
77 | * @return string |
||
78 | */ |
||
79 | 1 | public function attribute($id, $name) |
|
83 | |||
84 | /** |
||
85 | * Return the HTML fragment, spesified by id |
||
86 | * If multiple tags match - return the first one. |
||
87 | * @param string $id |
||
88 | * @return string |
||
89 | */ |
||
90 | 1 | public function html($id) |
|
94 | |||
95 | /** |
||
96 | * Return the plain text of an HTML fragment, spesified by id |
||
97 | * If multiple tags match - return the first one. |
||
98 | * @param string $id |
||
99 | * @return string |
||
100 | */ |
||
101 | 1 | public function text($id) |
|
105 | |||
106 | /** |
||
107 | * Retrun the value of an HTML fragment of a form input, spesified by id |
||
108 | * If multiple tags match - return the first one. |
||
109 | * The value is specific for diferrent for each input type. |
||
110 | * - input -> value |
||
111 | * - textarea -> content |
||
112 | * - checkbox -> checked |
||
113 | * - radios -> checked |
||
114 | * - select -> selected option |
||
115 | * |
||
116 | * @param string $id |
||
117 | * @return string |
||
118 | */ |
||
119 | 1 | public function value($id) |
|
123 | |||
124 | /** |
||
125 | * Return the visibility of an HTML fragment, spesified by id |
||
126 | * If multiple tags match - return the first one. |
||
127 | * |
||
128 | * @param string $id |
||
129 | * @return string |
||
130 | */ |
||
131 | 1 | public function is_visible($id) |
|
135 | |||
136 | /** |
||
137 | * Return if the option is selected or not, spesified by id |
||
138 | * If multiple tags match - return the first one. |
||
139 | * |
||
140 | * @param string $id |
||
141 | * @return string |
||
142 | */ |
||
143 | 1 | public function is_selected($id) |
|
147 | |||
148 | /** |
||
149 | * Return if the input (checkbox/radio) is checked or not, spesified by id |
||
150 | * If multiple tags match - return the first one. |
||
151 | * |
||
152 | * @param string $id |
||
153 | * @return string |
||
154 | */ |
||
155 | 1 | public function is_checked($id) |
|
159 | /** |
||
160 | * Set the value for a form input tag. |
||
161 | * If multiple tags match - use the first one. |
||
162 | * |
||
163 | * @param string $id |
||
164 | * @param mixed $value value |
||
165 | */ |
||
166 | 1 | public function set($id, $value) |
|
170 | |||
171 | /** |
||
172 | * Set an HTML option tag as selected or remove selection for a given XPath query. |
||
173 | * If multiple tags match - use the first one. |
||
174 | * |
||
175 | * @param string $id |
||
176 | * @param boolean $value |
||
177 | * @return $this |
||
178 | */ |
||
179 | 1 | public function select_option($id, $value) |
|
183 | |||
184 | /** |
||
185 | * Initiate a click on a given element. |
||
186 | * If multiple tags match - use the first one. |
||
187 | * You can click on anchor and submit buttons. |
||
188 | * |
||
189 | * @param string $id |
||
190 | * @return $this |
||
191 | */ |
||
192 | 1 | public function click($id) |
|
196 | |||
197 | /** |
||
198 | * Go to a specified url |
||
199 | * @param string $uri |
||
200 | * @param array $query |
||
201 | * @return $this |
||
202 | */ |
||
203 | 1 | public function visit($uri, array $query = array()) |
|
207 | |||
208 | /** |
||
209 | * Get the current url without domain |
||
210 | * @return string |
||
211 | */ |
||
212 | 1 | public function current_path() |
|
216 | |||
217 | /** |
||
218 | * Get the current url with domain |
||
219 | * @return string |
||
220 | */ |
||
221 | 1 | public function current_url() |
|
225 | |||
226 | /** |
||
227 | * Confirm or cancel for the next confirmation dialog |
||
228 | * @param bool $confirm |
||
229 | */ |
||
230 | 1 | public function confirm($confirm) |
|
234 | |||
235 | /** |
||
236 | * Get the text of the currently displayed alert / confirm /prompt dialog |
||
237 | * @param bool $confirm |
||
238 | */ |
||
239 | 1 | public function alert_text() |
|
243 | |||
244 | /** |
||
245 | * Return The root node |
||
246 | * @return Node |
||
247 | */ |
||
248 | 1 | public function is_page_active() |
|
252 | |||
253 | /** |
||
254 | * Move the mouse to a certain element |
||
255 | */ |
||
256 | 1 | public function move_to($id = NULL, $x = NULL, $y = NULL) |
|
260 | |||
261 | /** |
||
262 | * Take a screenshot ant place it in the given file |
||
263 | * @param string $file |
||
264 | */ |
||
265 | 1 | public function screenshot($file) |
|
269 | |||
270 | /** |
||
271 | * execute Javascript |
||
272 | */ |
||
273 | 1 | public function execute($id, $script) |
|
277 | |||
278 | /** |
||
279 | * Get the current browser user agent |
||
280 | */ |
||
281 | 1 | public function user_agent() |
|
285 | |||
286 | /** |
||
287 | * Manually set a cookie |
||
288 | * |
||
289 | * @param string $name |
||
290 | * @param string $value |
||
291 | * @param integer $expires |
||
292 | */ |
||
293 | 1 | public function cookie($name, $value, array $parameters = array()) |
|
297 | |||
298 | /** |
||
299 | * Return all the javascript errors on the page |
||
300 | * @return Node |
||
301 | */ |
||
302 | 1 | public function javascript_errors() |
|
306 | |||
307 | /** |
||
308 | * Return all the javascript console messages on the page |
||
309 | * @return Node |
||
310 | */ |
||
311 | 1 | public function javascript_messages() |
|
315 | |||
316 | /** |
||
317 | * Return The root node |
||
318 | * @return Node |
||
319 | */ |
||
320 | 9 | public function page() |
|
328 | |||
329 | /** |
||
330 | * Extract implicit query from URI |
||
331 | * |
||
332 | * @return array |
||
333 | */ |
||
334 | public static function extract_query_from_uri($uri) |
||
347 | |||
348 | } |
||
349 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.