@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace samsonframework\behatextension; |
6 | 6 | |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | $backtrace = debug_backtrace(); |
93 | 93 | |
94 | 94 | throw new \Exception( |
95 | - 'Timeout thrown by '.$backtrace[1]['class'].'::'.$backtrace[1]['function']."()\n" |
|
96 | - .(array_key_exists('file', $backtrace[1]) ? $backtrace[1]['file'].', line '.$backtrace[1]['line'] : '')."\n" |
|
95 | + 'Timeout thrown by ' . $backtrace[1]['class'] . '::' . $backtrace[1]['function'] . "()\n" |
|
96 | + .(array_key_exists('file', $backtrace[1]) ? $backtrace[1]['file'] . ', line ' . $backtrace[1]['line'] : '') . "\n" |
|
97 | 97 | .implode("\n", $failedExceptions) |
98 | 98 | ); |
99 | 99 | } |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | } |
114 | 114 | |
115 | 115 | $step = $scope->getStep(); |
116 | - $fileName = 'Fail.'.preg_replace('/[^a-zA-Z0-9-_\.]/', '_', $scope->getName().'-'.$step->getText()).'.jpg'; |
|
116 | + $fileName = 'Fail.' . preg_replace('/[^a-zA-Z0-9-_\.]/', '_', $scope->getName() . '-' . $step->getText()) . '.jpg'; |
|
117 | 117 | file_put_contents($fileName, $driver->getScreenshot()); |
118 | 118 | } |
119 | 119 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | { |
132 | 132 | $elements = []; |
133 | 133 | |
134 | - $this->spin(function (MinkContext $context) use ($selector, &$elements) { |
|
134 | + $this->spin(function(MinkContext $context) use ($selector, &$elements) { |
|
135 | 135 | $session = $context->getSession(); |
136 | 136 | |
137 | 137 | $elements = $session->getPage()->findAll('css', $context->fixStepArgument($selector)); |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | */ |
171 | 171 | public function iSetBrowserWindowSizeToX($width, $height) |
172 | 172 | { |
173 | - $this->getSession()->resizeWindow((int) $width, (int) $height, 'current'); |
|
173 | + $this->getSession()->resizeWindow((int)$width, (int)$height, 'current'); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | /** |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | */ |
181 | 181 | public function iWaitMillisecondsForResponse($delay = self::DELAY) |
182 | 182 | { |
183 | - $this->getSession()->wait((int) $delay); |
|
183 | + $this->getSession()->wait((int)$delay); |
|
184 | 184 | } |
185 | 185 | |
186 | 186 | /** |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | * @param string $page Page for assertion |
208 | 208 | */ |
209 | 209 | public function assertPageAddress($page) { |
210 | - $this->spin(function (MinkContext $context) use ($page) { |
|
210 | + $this->spin(function(MinkContext $context) use ($page) { |
|
211 | 211 | $context->assertSession()->addressEquals($this->locatePath($page)); |
212 | 212 | return true; |
213 | 213 | }); |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | */ |
248 | 248 | public function iScrollVerticallyToPx($yPos) |
249 | 249 | { |
250 | - $this->getSession()->executeScript('window.scrollTo(0, Math.min(document.documentElement.scrollHeight, document.body.scrollHeight, '.((int) $yPos).'));'); |
|
250 | + $this->getSession()->executeScript('window.scrollTo(0, Math.min(document.documentElement.scrollHeight, document.body.scrollHeight, ' . ((int)$yPos) . '));'); |
|
251 | 251 | } |
252 | 252 | |
253 | 253 | /** |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | */ |
258 | 258 | public function iScrollHorizontallyToPx($xPos) |
259 | 259 | { |
260 | - $this->getSession()->executeScript('window.scrollTo('.((int) $xPos).', 0);'); |
|
260 | + $this->getSession()->executeScript('window.scrollTo(' . ((int)$xPos) . ', 0);'); |
|
261 | 261 | } |
262 | 262 | |
263 | 263 | /** |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | { |
271 | 271 | // TODO: Change to Mink implementation |
272 | 272 | $this->getSession()->executeScript(" |
273 | - $('input[name=".$field."]').val('".$value."'); |
|
273 | + $('input[name=".$field . "]').val('" . $value . "'); |
|
274 | 274 | "); |
275 | 275 | } |
276 | 276 | |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | */ |
321 | 321 | public function iFillInTheElementUsingJs(string $selector, string $value) |
322 | 322 | { |
323 | - $this->getSession()->executeScript('document.querySelectorAll("'.$selector.'")[0].value="'.$value.'";'); |
|
323 | + $this->getSession()->executeScript('document.querySelectorAll("' . $selector . '")[0].value="' . $value . '";'); |
|
324 | 324 | } |
325 | 325 | |
326 | 326 | /** |