@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | * |
74 | 74 | * @param array $actual |
75 | 75 | * the array to be tested |
76 | - * @return \Prose\AssertsArray |
|
76 | + * @return AssertsArray |
|
77 | 77 | */ |
78 | 78 | public static function assertsArray($actual) |
79 | 79 | { |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * |
86 | 86 | * @param boolean $actual |
87 | 87 | * the data to be tested |
88 | - * @return \Prose\AssertsBoolean |
|
88 | + * @return AssertsBoolean |
|
89 | 89 | */ |
90 | 90 | public static function assertsBoolean($actual) |
91 | 91 | { |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * |
98 | 98 | * @param double $actual |
99 | 99 | * the data to be tested |
100 | - * @return \Prose\AssertsDouble |
|
100 | + * @return AssertsDouble |
|
101 | 101 | */ |
102 | 102 | public static function assertsDouble($actual) |
103 | 103 | { |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | * |
110 | 110 | * @param int $actual |
111 | 111 | * the data to be tested |
112 | - * @return \Prose\AssertsInteger |
|
112 | + * @return AssertsInteger |
|
113 | 113 | */ |
114 | 114 | public static function assertsInteger($actual) |
115 | 115 | { |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | * |
122 | 122 | * @param object $actual |
123 | 123 | * the data to be tested |
124 | - * @return \Prose\AssertsObject |
|
124 | + * @return AssertsObject |
|
125 | 125 | */ |
126 | 126 | public static function assertsObject($actual) |
127 | 127 | { |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | * |
134 | 134 | * @param string $actual |
135 | 135 | * the data to be tested |
136 | - * @return \Prose\AssertsString |
|
136 | + * @return AssertsString |
|
137 | 137 | */ |
138 | 138 | public static function assertsString($actual) |
139 | 139 | { |
@@ -50,7 +50,6 @@ |
||
50 | 50 | /** |
51 | 51 | * Create a new story object |
52 | 52 | * |
53 | - * @param string $category the category that the story belongs to |
|
54 | 53 | * @return Story the new story object to use |
55 | 54 | */ |
56 | 55 | public static function newStory() |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | /** |
73 | 73 | * tick a checkbox or radio button if it has not yet been checked |
74 | 74 | * |
75 | - * @return \DataSift\Storyplayer\BrowserLib\SingleElementAction |
|
75 | + * @return SingleElementAction |
|
76 | 76 | */ |
77 | 77 | public function check() |
78 | 78 | { |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * remove any content from an input box, or untick a checkbox or |
102 | 102 | * radio button |
103 | 103 | * |
104 | - * @return \DataSift\Storyplayer\BrowserLib\SingleElementAction |
|
104 | + * @return SingleElementAction |
|
105 | 105 | */ |
106 | 106 | public function clear() |
107 | 107 | { |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | /** |
133 | 133 | * Send a 'click' to the selected element |
134 | 134 | * |
135 | - * @return \DataSift\Storyplayer\BrowserLib\SingleElementAction |
|
135 | + * @return SingleElementAction |
|
136 | 136 | */ |
137 | 137 | public function click() |
138 | 138 | { |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | * |
155 | 155 | * @param string $label |
156 | 156 | * the human-readable text of the option to select |
157 | - * @return \DataSift\Storyplayer\BrowserLib\SingleElementAction |
|
157 | + * @return SingleElementAction |
|
158 | 158 | */ |
159 | 159 | public function select($label) |
160 | 160 | { |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | * |
186 | 186 | * @param string $text |
187 | 187 | * the text to type |
188 | - * @return \DataSift\Storyplayer\BrowserLib\SingleElementAction |
|
188 | + * @return SingleElementAction |
|
189 | 189 | */ |
190 | 190 | public function type($text) |
191 | 191 | { |
@@ -214,6 +214,9 @@ discard block |
||
214 | 214 | // |
215 | 215 | // ------------------------------------------------------------------ |
216 | 216 | |
217 | + /** |
|
218 | + * @param string $url |
|
219 | + */ |
|
217 | 220 | public function gotoPage($url) |
218 | 221 | { |
219 | 222 | // some shorthand to make things easier to read |
@@ -159,7 +159,7 @@ |
||
159 | 159 | */ |
160 | 160 | public function select($label) |
161 | 161 | { |
162 | - $action = function ($element, $elementName, $elementDesc) use ($label) { |
|
162 | + $action = function($element, $elementName, $elementDesc) use ($label) { |
|
163 | 163 | |
164 | 164 | // what are we doing? |
165 | 165 | $log = usingLog()->startAction("choose option '$label' from $elementDesc '$elementName'"); |
@@ -77,8 +77,7 @@ |
||
77 | 77 | |
78 | 78 | return $return; |
79 | 79 | } |
80 | - catch (Exception $e) |
|
81 | - { |
|
80 | + catch (Exception $e) { |
|
82 | 81 | throw new E5xx_ActionFailed(__METHOD__, $e->getMessage()); |
83 | 82 | } |
84 | 83 | } |
@@ -121,11 +121,11 @@ discard block |
||
121 | 121 | |
122 | 122 | protected $tagTypes = array( |
123 | 123 | 'button' => array('input', 'button'), |
124 | - 'buttons' => array('input','button'), |
|
124 | + 'buttons' => array('input', 'button'), |
|
125 | 125 | 'cell' => 'td', |
126 | 126 | 'cells' => 'td', |
127 | - 'heading' => array('h1', 'h2', 'h3', 'h4', 'h5','h6'), |
|
128 | - 'headings' => array('h1', 'h2', 'h3', 'h4', 'h5','h6'), |
|
127 | + 'heading' => array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'), |
|
128 | + 'headings' => array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'), |
|
129 | 129 | 'link' => 'a', |
130 | 130 | 'links' => 'a', |
131 | 131 | 'orderedlist' => 'ol', |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | 'unorderedlist' => self::SINGLE_TARGET |
155 | 155 | ); |
156 | 156 | |
157 | - protected $searchTypes = array ( |
|
157 | + protected $searchTypes = array( |
|
158 | 158 | 'id' => 'ById', |
159 | 159 | 'label' => 'ByLabel', |
160 | 160 | 'labelled' => 'ByLabel', |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | { |
297 | 297 | // we need to know which element they want |
298 | 298 | $words = $this->convertMethodNameToWords($methodName); |
299 | - $indexType = $this->determineIndexType($words); |
|
299 | + $indexType = $this->determineIndexType($words); |
|
300 | 300 | |
301 | 301 | // get all the elements that match |
302 | 302 | $elements = $this->retrieveElements($methodName, $methodArgs); |
@@ -323,7 +323,8 @@ |
||
323 | 323 | $searchTerm = $methodArgs[0]; |
324 | 324 | |
325 | 325 | $searchType = $this->determineSearchType($words); |
326 | - if ($searchType === null) { // we do not understand how to find the target field |
|
326 | + if ($searchType === null) { |
|
327 | +// we do not understand how to find the target field |
|
327 | 328 | throw new E5xx_ActionFailed(__CLASS__ . '::' . $methodName, "could not work out how to find the target to action upon"); |
328 | 329 | } |
329 | 330 |
@@ -245,8 +245,7 @@ discard block |
||
245 | 245 | |
246 | 246 | // search all of the label elements to find an associated input |
247 | 247 | // element that we can safely use |
248 | - foreach ($labelElements as $labelElement) |
|
249 | - { |
|
248 | + foreach ($labelElements as $labelElement) { |
|
250 | 249 | try { |
251 | 250 | // add each element that matches this label |
252 | 251 | $retval[] = $this->getElementAssociatedWithLabelElement($labelElement, $labelText); |
@@ -289,8 +288,7 @@ discard block |
||
289 | 288 | } |
290 | 289 | |
291 | 290 | // what do we do next? |
292 | - if ($inputElementId !== null) |
|
293 | - { |
|
291 | + if ($inputElementId !== null) { |
|
294 | 292 | // where does the 'for' attribute go? |
295 | 293 | try { |
296 | 294 | $inputElement = $log->addStep("find the input element with the id '{$inputElementId}'", function() use($topElement, $inputElementId) { |
@@ -121,7 +121,7 @@ |
||
121 | 121 | $log = usingLog()->startAction("$elementDesc '$elementName' must exist"); |
122 | 122 | |
123 | 123 | $actualCount = count($elements); |
124 | - switch($requiredCount) { |
|
124 | + switch ($requiredCount) { |
|
125 | 125 | // this satisfies something like: |
126 | 126 | // |
127 | 127 | // expectsBrowser()->has()->fieldWithId('XX'); |
@@ -272,7 +272,7 @@ |
||
272 | 272 | $log = usingLog()->startAction("retrieve the value of the $elementDesc '$elementName'"); |
273 | 273 | |
274 | 274 | // is this a select box? |
275 | - switch($element->name()) { |
|
275 | + switch ($element->name()) { |
|
276 | 276 | case 'select': |
277 | 277 | // get the option that is selected |
278 | 278 | try { |
@@ -350,8 +350,7 @@ discard block |
||
350 | 350 | // all done |
351 | 351 | return $credentials; |
352 | 352 | } |
353 | - catch (Exception $e) |
|
354 | - { |
|
353 | + catch (Exception $e) { |
|
355 | 354 | return null; |
356 | 355 | } |
357 | 356 | } |
@@ -370,8 +369,7 @@ discard block |
||
370 | 369 | // get the details |
371 | 370 | return $adapter->hasHttpBasicAuthForHost($hostname); |
372 | 371 | } |
373 | - catch (Exception $e) |
|
374 | - { |
|
372 | + catch (Exception $e) { |
|
375 | 373 | return false; |
376 | 374 | } |
377 | 375 | } |
@@ -87,7 +87,7 @@ |
||
87 | 87 | $words = $this->convertMethodNameToWords($methodName); |
88 | 88 | |
89 | 89 | // how many elements are we searching for? |
90 | - $countType = $this->determineCountType($words); |
|
90 | + $countType = $this->determineCountType($words); |
|
91 | 91 | |
92 | 92 | // get the elements we need |
93 | 93 | $elements = $this->retrieveElements($methodName, $methodArgs); |
@@ -77,7 +77,7 @@ |
||
77 | 77 | } |
78 | 78 | |
79 | 79 | // yes, it really is a form |
80 | - $this->formId = $formId; |
|
80 | + $this->formId = $formId; |
|
81 | 81 | $this->setTopElement($formElement); |
82 | 82 | } |
83 | 83 |