@@ -121,8 +121,8 @@ discard block |
||
121 | 121 | $this->setDefinition([ |
122 | 122 | new InputArgument('suite', InputArgument::OPTIONAL, 'suite to be tested'), |
123 | 123 | new InputArgument('test', InputArgument::OPTIONAL, 'test to be run'), |
124 | - new InputOption('override', 'o', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Override config values'), |
|
125 | - new InputOption('ext', 'e', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Run with extension enabled'), |
|
124 | + new InputOption('override', 'o', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Override config values'), |
|
125 | + new InputOption('ext', 'e', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Run with extension enabled'), |
|
126 | 126 | new InputOption('report', '', InputOption::VALUE_NONE, 'Show output in compact style'), |
127 | 127 | new InputOption('html', '', InputOption::VALUE_OPTIONAL, 'Generate html with results', 'report.html'), |
128 | 128 | new InputOption('xml', '', InputOption::VALUE_OPTIONAL, 'Generate JUnit XML Log', 'report.xml'), |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | } |
242 | 242 | if (!$this->options['silent']) { |
243 | 243 | $this->output->writeln( |
244 | - Codecept::versionString() . "\nPowered by " . \PHPUnit\Runner\Version::getVersionString() |
|
244 | + Codecept::versionString()."\nPowered by ".\PHPUnit\Runner\Version::getVersionString() |
|
245 | 245 | ); |
246 | 246 | } |
247 | 247 | if ($this->options['debug']) { |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | ); |
316 | 316 | } |
317 | 317 | |
318 | - $testsPath = $include . DIRECTORY_SEPARATOR. $config['paths']['tests']; |
|
318 | + $testsPath = $include.DIRECTORY_SEPARATOR.$config['paths']['tests']; |
|
319 | 319 | |
320 | 320 | try { |
321 | 321 | list(, $suite, $test) = $this->matchTestFromFilename($suite, $testsPath); |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | // Workaround when codeception.yml is inside tests directory and tests path is set to "." |
388 | 388 | // @see https://github.com/Codeception/Codeception/issues/4432 |
389 | 389 | if ($config['paths']['tests'] === '.' && !preg_match('~^\.[/\\\]~', $suite)) { |
390 | - $suite = './' . $suite; |
|
390 | + $suite = './'.$suite; |
|
391 | 391 | } |
392 | 392 | |
393 | 393 | // running a single test when suite has a configured path |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | if (!isset($suiteConfig['path'])) { |
397 | 397 | continue; |
398 | 398 | } |
399 | - $testsPath = $config['paths']['tests'] . DIRECTORY_SEPARATOR . $suiteConfig['path']; |
|
399 | + $testsPath = $config['paths']['tests'].DIRECTORY_SEPARATOR.$suiteConfig['path']; |
|
400 | 400 | if ($suiteConfig['path'] === '.') { |
401 | 401 | $testsPath = $config['paths']['tests']; |
402 | 402 | } |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | } |
410 | 410 | |
411 | 411 | // Run single test without included tests |
412 | - if (! Configuration::isEmpty() && strpos($suite, $config['paths']['tests']) === 0) { |
|
412 | + if (!Configuration::isEmpty() && strpos($suite, $config['paths']['tests']) === 0) { |
|
413 | 413 | return $this->matchTestFromFilename($suite, $config['paths']['tests']); |
414 | 414 | } |
415 | 415 | } |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | protected function runIncludedSuites($suites, $parent_dir) |
424 | 424 | { |
425 | 425 | foreach ($suites as $relativePath) { |
426 | - $current_dir = rtrim($parent_dir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $relativePath; |
|
426 | + $current_dir = rtrim($parent_dir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.$relativePath; |
|
427 | 427 | $config = Configuration::config($current_dir); |
428 | 428 | $suites = Configuration::suites(); |
429 | 429 |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | throw new ConfigurationException("Interactive shell can't be started without an actor"); |
86 | 86 | } |
87 | 87 | if (isset($config["namespace"])) { |
88 | - $settings['actor'] = $config["namespace"] .'\\' . $settings['actor']; |
|
88 | + $settings['actor'] = $config["namespace"].'\\'.$settings['actor']; |
|
89 | 89 | } |
90 | 90 | $actor = $settings['actor']; |
91 | 91 | $I = new $actor($scenario); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | $command = $dialog->ask($input, $output, $question); |
128 | 128 | if ($command == 'actions') { |
129 | - $output->writeln("<info>" . implode(' ', $this->actions)); |
|
129 | + $output->writeln("<info>".implode(' ', $this->actions)); |
|
130 | 130 | continue; |
131 | 131 | } |
132 | 132 | if ($command == 'exit') { |
@@ -141,9 +141,9 @@ discard block |
||
141 | 141 | codecept_debug($value); |
142 | 142 | } |
143 | 143 | } catch (\PHPUnit\Framework\AssertionFailedError $fail) { |
144 | - $output->writeln("<error>fail</error> " . $fail->getMessage()); |
|
144 | + $output->writeln("<error>fail</error> ".$fail->getMessage()); |
|
145 | 145 | } catch (\Exception $e) { |
146 | - $output->writeln("<error>error</error> " . $e->getMessage()); |
|
146 | + $output->writeln("<error>error</error> ".$e->getMessage()); |
|
147 | 147 | } |
148 | 148 | } while (true); |
149 | 149 | } |
@@ -62,10 +62,10 @@ discard block |
||
62 | 62 | if (is_array($tests)) { |
63 | 63 | foreach ($tests as $test) { |
64 | 64 | $file = str_replace(['/', '\\'], [DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR], $test); |
65 | - $this->testsInGroups[$group][] = Configuration::projectDir() . $file; |
|
65 | + $this->testsInGroups[$group][] = Configuration::projectDir().$file; |
|
66 | 66 | } |
67 | - } elseif (is_file(Configuration::projectDir() . $tests)) { |
|
68 | - $handle = @fopen(Configuration::projectDir() . $tests, "r"); |
|
67 | + } elseif (is_file(Configuration::projectDir().$tests)) { |
|
68 | + $handle = @fopen(Configuration::projectDir().$tests, "r"); |
|
69 | 69 | if ($handle) { |
70 | 70 | while (($test = fgets($handle, 4096)) !== false) { |
71 | 71 | // if the current line is blank then we need to move to the next line |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | continue; |
76 | 76 | } |
77 | 77 | |
78 | - $file = trim(Configuration::projectDir() . $test); |
|
78 | + $file = trim(Configuration::projectDir().$test); |
|
79 | 79 | $file = str_replace(['/', '\\'], [DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR], $file); |
80 | 80 | $this->testsInGroups[$group][] = $file; |
81 | 81 | } |
@@ -115,13 +115,13 @@ discard block |
||
115 | 115 | if ($filename == $testPattern) { |
116 | 116 | $groups[] = $group; |
117 | 117 | } |
118 | - if (strpos($filename . ':' . $test->getName(false), $testPattern) === 0) { |
|
118 | + if (strpos($filename.':'.$test->getName(false), $testPattern) === 0) { |
|
119 | 119 | $groups[] = $group; |
120 | 120 | } |
121 | 121 | if ($test instanceof \PHPUnit\Framework\TestSuite\DataProvider) { |
122 | 122 | $firstTest = $test->testAt(0); |
123 | 123 | if ($firstTest != false && $firstTest instanceof TestInterface) { |
124 | - if (strpos($filename . ':' . $firstTest->getName(false), $testPattern) === 0) { |
|
124 | + if (strpos($filename.':'.$firstTest->getName(false), $testPattern) === 0) { |
|
125 | 125 | $groups[] = $group; |
126 | 126 | } |
127 | 127 | } |
@@ -32,13 +32,13 @@ |
||
32 | 32 | private function cleanProjectsRecursively(OutputInterface $output, $projectDir) |
33 | 33 | { |
34 | 34 | $logDir = Configuration::logDir(); |
35 | - $output->writeln("<info>Cleaning up output " . $logDir . "...</info>"); |
|
35 | + $output->writeln("<info>Cleaning up output ".$logDir."...</info>"); |
|
36 | 36 | FileSystem::doEmptyDir($logDir); |
37 | 37 | |
38 | 38 | $config = Configuration::config($projectDir); |
39 | 39 | $subProjects = $config['include']; |
40 | 40 | foreach ($subProjects as $subProject) { |
41 | - $subProjectDir = $projectDir . $subProject; |
|
41 | + $subProjectDir = $projectDir.$subProject; |
|
42 | 42 | $this->cleanProjectsRecursively($output, $subProjectDir); |
43 | 43 | } |
44 | 44 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | return $testCase->getSignature(); |
20 | 20 | } |
21 | 21 | if ($testCase instanceof \PHPUnit\Framework\TestCase) { |
22 | - return get_class($testCase) . ':' . $testCase->getName(false); |
|
22 | + return get_class($testCase).':'.$testCase->getName(false); |
|
23 | 23 | } |
24 | 24 | return $testCase->toString(); |
25 | 25 | } |
@@ -37,10 +37,10 @@ discard block |
||
37 | 37 | if (is_callable([$testCase, 'getMetadata']) |
38 | 38 | && $example = $testCase->getMetadata()->getCurrent('example') |
39 | 39 | ) { |
40 | - $example = ':' . substr(sha1(json_encode($example)), 0, 7); |
|
40 | + $example = ':'.substr(sha1(json_encode($example)), 0, 7); |
|
41 | 41 | } |
42 | 42 | |
43 | - return self::getTestSignature($testCase) . $example; |
|
43 | + return self::getTestSignature($testCase).$example; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | public static function getTestAsString(\PHPUnit\Framework\SelfDescribing $testCase) |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $text = preg_replace('/^test /', '', $text); |
53 | 53 | $text = ucfirst(strtolower($text)); |
54 | 54 | $text = str_replace(['::', 'with data set'], [':', '|'], $text); |
55 | - return ReflectionHelper::getClassShortName($testCase) . ': ' . $text; |
|
55 | + return ReflectionHelper::getClassShortName($testCase).': '.$text; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | return $testCase->toString(); |
@@ -83,12 +83,12 @@ discard block |
||
83 | 83 | } |
84 | 84 | if ($testCase instanceof Descriptive) { |
85 | 85 | $signature = $testCase->getSignature(); // cut everything before ":" from signature |
86 | - return self::getTestFileName($testCase) . ':' . preg_replace('~^(.*?):~', '', $signature); |
|
86 | + return self::getTestFileName($testCase).':'.preg_replace('~^(.*?):~', '', $signature); |
|
87 | 87 | } |
88 | 88 | if ($testCase instanceof \PHPUnit\Framework\TestCase) { |
89 | - return self::getTestFileName($testCase) . ':' . $testCase->getName(false); |
|
89 | + return self::getTestFileName($testCase).':'.$testCase->getName(false); |
|
90 | 90 | } |
91 | - return self::getTestFileName($testCase) . ':' . $testCase->toString(); |
|
91 | + return self::getTestFileName($testCase).':'.$testCase->toString(); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | if (file_exists($firefox_profile) === false) { |
470 | 470 | throw new ModuleConfigException( |
471 | 471 | __CLASS__, |
472 | - "Firefox profile does not exist under given path " . $firefox_profile |
|
472 | + "Firefox profile does not exist under given path ".$firefox_profile |
|
473 | 473 | ); |
474 | 474 | } |
475 | 475 | // Set firefox profile as capability |
@@ -504,9 +504,9 @@ discard block |
||
504 | 504 | $this->debugWebDriverLogs($test); |
505 | 505 | $filename = preg_replace('~\W~', '.', Descriptor::getTestSignatureUnique($test)); |
506 | 506 | $outputDir = codecept_output_dir(); |
507 | - $this->_saveScreenshot($report = $outputDir . mb_strcut($filename, 0, 245, 'utf-8') . '.fail.png'); |
|
507 | + $this->_saveScreenshot($report = $outputDir.mb_strcut($filename, 0, 245, 'utf-8').'.fail.png'); |
|
508 | 508 | $test->getMetadata()->addReport('png', $report); |
509 | - $this->_savePageSource($report = $outputDir . mb_strcut($filename, 0, 244, 'utf-8') . '.fail.html'); |
|
509 | + $this->_savePageSource($report = $outputDir.mb_strcut($filename, 0, 244, 'utf-8').'.fail.html'); |
|
510 | 510 | $test->getMetadata()->addReport('html', $report); |
511 | 511 | $this->debug("Screenshot and page source were saved into '$outputDir' dir"); |
512 | 512 | } |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | $this->debugSection("Selenium {$logType} Logs", " EMPTY "); |
536 | 536 | continue; |
537 | 537 | } |
538 | - $this->debugSection("Selenium {$logType} Logs", "\n" . $this->formatLogEntries($logEntries)); |
|
538 | + $this->debugSection("Selenium {$logType} Logs", "\n".$this->formatLogEntries($logEntries)); |
|
539 | 539 | |
540 | 540 | if ($logType === 'browser' && $this->config['log_js_errors'] |
541 | 541 | && ($test instanceof ScenarioDriven) |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | } |
545 | 545 | } |
546 | 546 | } catch (\Exception $e) { |
547 | - $this->debug('Unable to retrieve Selenium logs : ' . $e->getMessage()); |
|
547 | + $this->debug('Unable to retrieve Selenium logs : '.$e->getMessage()); |
|
548 | 548 | } |
549 | 549 | } |
550 | 550 | |
@@ -562,9 +562,9 @@ discard block |
||
562 | 562 | |
563 | 563 | foreach ($logEntries as $logEntry) { |
564 | 564 | // Timestamp is in milliseconds, but date() requires seconds. |
565 | - $time = date('H:i:s', $logEntry['timestamp'] / 1000) . |
|
565 | + $time = date('H:i:s', $logEntry['timestamp'] / 1000). |
|
566 | 566 | // Append the milliseconds to the end of the time string |
567 | - '.' . ($logEntry['timestamp'] % 1000); |
|
567 | + '.'.($logEntry['timestamp'] % 1000); |
|
568 | 568 | $formattedLogs .= "{$time} {$logEntry['level']} - {$logEntry['message']}\n"; |
569 | 569 | } |
570 | 570 | return $formattedLogs; |
@@ -584,9 +584,9 @@ discard block |
||
584 | 584 | && $this->isJSError($logEntry['level'], $logEntry['message']) |
585 | 585 | ) { |
586 | 586 | // Timestamp is in milliseconds, but date() requires seconds. |
587 | - $time = date('H:i:s', $logEntry['timestamp'] / 1000) . |
|
587 | + $time = date('H:i:s', $logEntry['timestamp'] / 1000). |
|
588 | 588 | // Append the milliseconds to the end of the time string |
589 | - '.' . ($logEntry['timestamp'] % 1000); |
|
589 | + '.'.($logEntry['timestamp'] % 1000); |
|
590 | 590 | $test->getScenario()->comment("{$time} {$logEntry['level']} - {$logEntry['message']}"); |
591 | 591 | } |
592 | 592 | } |
@@ -607,7 +607,7 @@ discard block |
||
607 | 607 | ($this->isPhantom() && $logEntryLevel != 'INFO') // phantomjs logs errors as "WARNING" |
608 | 608 | || $logEntryLevel === 'SEVERE' // other browsers log errors as "SEVERE" |
609 | 609 | ) |
610 | - && strpos($message, 'ERR_PROXY_CONNECTION_FAILED') === false; // ignore blackhole proxy |
|
610 | + && strpos($message, 'ERR_PROXY_CONNECTION_FAILED') === false; // ignore blackhole proxy |
|
611 | 611 | } |
612 | 612 | |
613 | 613 | public function _afterSuite() |
@@ -657,13 +657,13 @@ discard block |
||
657 | 657 | if ($this->config['http_proxy']) { |
658 | 658 | $proxyConfig['httpProxy'] = $this->config['http_proxy']; |
659 | 659 | if ($this->config['http_proxy_port']) { |
660 | - $proxyConfig['httpProxy'] .= ':' . $this->config['http_proxy_port']; |
|
660 | + $proxyConfig['httpProxy'] .= ':'.$this->config['http_proxy_port']; |
|
661 | 661 | } |
662 | 662 | } |
663 | 663 | if ($this->config['ssl_proxy']) { |
664 | 664 | $proxyConfig['sslProxy'] = $this->config['ssl_proxy']; |
665 | 665 | if ($this->config['ssl_proxy_port']) { |
666 | - $proxyConfig['sslProxy'] .= ':' . $this->config['ssl_proxy_port']; |
|
666 | + $proxyConfig['sslProxy'] .= ':'.$this->config['ssl_proxy_port']; |
|
667 | 667 | } |
668 | 668 | } |
669 | 669 | if (!empty($proxyConfig)) { |
@@ -697,7 +697,7 @@ discard block |
||
697 | 697 | try { |
698 | 698 | $this->webDriver->takeScreenshot($filename); |
699 | 699 | } catch (\Exception $e) { |
700 | - $this->debug('Unable to retrieve screenshot from Selenium : ' . $e->getMessage()); |
|
700 | + $this->debug('Unable to retrieve screenshot from Selenium : '.$e->getMessage()); |
|
701 | 701 | } |
702 | 702 | } |
703 | 703 | |
@@ -719,7 +719,7 @@ discard block |
||
719 | 719 | try { |
720 | 720 | file_put_contents($filename, $this->webDriver->getPageSource()); |
721 | 721 | } catch (\Exception $e) { |
722 | - $this->debug('Unable to retrieve source page from Selenium : ' . $e->getMessage()); |
|
722 | + $this->debug('Unable to retrieve source page from Selenium : '.$e->getMessage()); |
|
723 | 723 | } |
724 | 724 | } |
725 | 725 | |
@@ -742,11 +742,11 @@ discard block |
||
742 | 742 | if (empty($name)) { |
743 | 743 | $name = uniqid(date("Y-m-d_H-i-s_")); |
744 | 744 | } |
745 | - $debugDir = codecept_log_dir() . 'debug'; |
|
745 | + $debugDir = codecept_log_dir().'debug'; |
|
746 | 746 | if (!is_dir($debugDir)) { |
747 | 747 | mkdir($debugDir, 0777); |
748 | 748 | } |
749 | - $screenName = $debugDir . DIRECTORY_SEPARATOR . $name . '.png'; |
|
749 | + $screenName = $debugDir.DIRECTORY_SEPARATOR.$name.'.png'; |
|
750 | 750 | $this->_saveScreenshot($screenName); |
751 | 751 | $this->debug("Screenshot saved to $screenName"); |
752 | 752 | } |
@@ -772,7 +772,7 @@ discard block |
||
772 | 772 | { |
773 | 773 | $cookies = $this->filterCookies($this->webDriver->manage()->getCookies(), $params); |
774 | 774 | $cookies = array_map( |
775 | - function ($c) { |
|
775 | + function($c) { |
|
776 | 776 | return $c['name']; |
777 | 777 | }, |
778 | 778 | $cookies |
@@ -785,7 +785,7 @@ discard block |
||
785 | 785 | { |
786 | 786 | $cookies = $this->filterCookies($this->webDriver->manage()->getCookies(), $params); |
787 | 787 | $cookies = array_map( |
788 | - function ($c) { |
|
788 | + function($c) { |
|
789 | 789 | return $c['name']; |
790 | 790 | }, |
791 | 791 | $cookies |
@@ -851,7 +851,7 @@ discard block |
||
851 | 851 | } |
852 | 852 | $cookies = array_filter( |
853 | 853 | $cookies, |
854 | - function ($item) use ($filter, $params) { |
|
854 | + function($item) use ($filter, $params) { |
|
855 | 855 | return $item[$filter] == $params[$filter]; |
856 | 856 | } |
857 | 857 | ); |
@@ -1125,7 +1125,7 @@ discard block |
||
1125 | 1125 | |
1126 | 1126 | $nodes = array_filter( |
1127 | 1127 | $nodes, |
1128 | - function (WebDriverElement $e) use ($expectedUrl, $absoluteCurrentUrl) { |
|
1128 | + function(WebDriverElement $e) use ($expectedUrl, $absoluteCurrentUrl) { |
|
1129 | 1129 | $elementHref = Uri::mergeUrls($absoluteCurrentUrl, $e->getAttribute('href')); |
1130 | 1130 | return $elementHref === $expectedUrl; |
1131 | 1131 | } |
@@ -1171,7 +1171,7 @@ discard block |
||
1171 | 1171 | $matches = []; |
1172 | 1172 | $res = preg_match($uri, $this->_getCurrentUri(), $matches); |
1173 | 1173 | if (!$res) { |
1174 | - $this->fail("Couldn't match $uri in " . $this->_getCurrentUri()); |
|
1174 | + $this->fail("Couldn't match $uri in ".$this->_getCurrentUri()); |
|
1175 | 1175 | } |
1176 | 1176 | if (!isset($matches[1])) { |
1177 | 1177 | $this->fail("Nothing to grab. A regex parameter required. Ex: '/user/(\\d+)'"); |
@@ -1322,7 +1322,7 @@ discard block |
||
1322 | 1322 | 'Contains', |
1323 | 1323 | $value, |
1324 | 1324 | $currentValues, |
1325 | - "Failed testing for '$value' in $strField's value: '" . implode("', '", $currentValues) . "'" |
|
1325 | + "Failed testing for '$value' in $strField's value: '".implode("', '", $currentValues)."'" |
|
1326 | 1326 | ]; |
1327 | 1327 | } |
1328 | 1328 | |
@@ -1386,7 +1386,7 @@ discard block |
||
1386 | 1386 | // partially matching |
1387 | 1387 | foreach ($option as $opt) { |
1388 | 1388 | try { |
1389 | - $optElement = $el->findElement(WebDriverBy::xpath('.//option [contains (., "' . $opt . '")]')); |
|
1389 | + $optElement = $el->findElement(WebDriverBy::xpath('.//option [contains (., "'.$opt.'")]')); |
|
1390 | 1390 | $matched = true; |
1391 | 1391 | if (!$optElement->isSelected()) { |
1392 | 1392 | $optElement->click(); |
@@ -1647,7 +1647,7 @@ discard block |
||
1647 | 1647 | { |
1648 | 1648 | $el = $this->findField($field); |
1649 | 1649 | // in order to be compatible on different OS |
1650 | - $filePath = codecept_data_dir() . $filename; |
|
1650 | + $filePath = codecept_data_dir().$filename; |
|
1651 | 1651 | if (!file_exists($filePath)) { |
1652 | 1652 | throw new \InvalidArgumentException("File does not exist: $filePath"); |
1653 | 1653 | } |
@@ -1714,7 +1714,7 @@ discard block |
||
1714 | 1714 | { |
1715 | 1715 | $els = $this->match($this->baseElement, $cssOrXpath); |
1716 | 1716 | return array_map( |
1717 | - function (WebDriverElement $e) use ($attribute) { |
|
1717 | + function(WebDriverElement $e) use ($attribute) { |
|
1718 | 1718 | if ($attribute) { |
1719 | 1719 | return $e->getAttribute($attribute); |
1720 | 1720 | } |
@@ -1730,7 +1730,7 @@ discard block |
||
1730 | 1730 | foreach ($attributes as $attr => $value) { |
1731 | 1731 | $els = array_filter( |
1732 | 1732 | $els, |
1733 | - function (WebDriverElement $el) use ($attr, $value) { |
|
1733 | + function(WebDriverElement $el) use ($attr, $value) { |
|
1734 | 1734 | return $el->getAttribute($attr) == $value; |
1735 | 1735 | } |
1736 | 1736 | ); |
@@ -1836,7 +1836,7 @@ discard block |
||
1836 | 1836 | $this->assertNotEmpty( |
1837 | 1837 | array_filter( |
1838 | 1838 | $els, |
1839 | - function ($e) { |
|
1839 | + function($e) { |
|
1840 | 1840 | return $e && $e->isSelected(); |
1841 | 1841 | } |
1842 | 1842 | ) |
@@ -1858,7 +1858,7 @@ discard block |
||
1858 | 1858 | $this->assertEmpty( |
1859 | 1859 | array_filter( |
1860 | 1860 | $els, |
1861 | - function ($e) { |
|
1861 | + function($e) { |
|
1862 | 1862 | return $e && $e->isSelected(); |
1863 | 1863 | } |
1864 | 1864 | ) |
@@ -2256,7 +2256,7 @@ discard block |
||
2256 | 2256 | public function waitForElementChange($element, \Closure $callback, $timeout = 30) |
2257 | 2257 | { |
2258 | 2258 | $el = $this->matchFirstOrFail($this->baseElement, $element); |
2259 | - $checker = function () use ($el, $callback) { |
|
2259 | + $checker = function() use ($el, $callback) { |
|
2260 | 2260 | return $callback($el); |
2261 | 2261 | }; |
2262 | 2262 | $this->webDriver->wait($timeout)->until($checker); |
@@ -2486,7 +2486,7 @@ discard block |
||
2486 | 2486 | */ |
2487 | 2487 | public function waitForJS($script, $timeout = 5) |
2488 | 2488 | { |
2489 | - $condition = function ($wd) use ($script) { |
|
2489 | + $condition = function($wd) use ($script) { |
|
2490 | 2490 | return $wd->executeScript($script); |
2491 | 2491 | }; |
2492 | 2492 | $message = sprintf( |
@@ -2694,12 +2694,12 @@ discard block |
||
2694 | 2694 | try { |
2695 | 2695 | return $page->findElements($this->getStrictLocator($selector)); |
2696 | 2696 | } catch (InvalidSelectorException $e) { |
2697 | - throw new MalformedLocatorException(key($selector) . ' => ' . reset($selector), "Strict locator"); |
|
2697 | + throw new MalformedLocatorException(key($selector).' => '.reset($selector), "Strict locator"); |
|
2698 | 2698 | } catch (InvalidElementStateException $e) { |
2699 | 2699 | if ($this->isPhantom() and $e->getResults()['status'] == 12) { |
2700 | 2700 | throw new MalformedLocatorException( |
2701 | - key($selector) . ' => ' . reset($selector), |
|
2702 | - "Strict locator " . $e->getCode() |
|
2701 | + key($selector).' => '.reset($selector), |
|
2702 | + "Strict locator ".$e->getCode() |
|
2703 | 2703 | ); |
2704 | 2704 | } |
2705 | 2705 | } |
@@ -2984,7 +2984,7 @@ discard block |
||
2984 | 2984 | $els = $this->match($this->baseElement, $selector); |
2985 | 2985 | $nodes = array_filter( |
2986 | 2986 | $els, |
2987 | - function (WebDriverElement $el) { |
|
2987 | + function(WebDriverElement $el) { |
|
2988 | 2988 | return $el->isDisplayed(); |
2989 | 2989 | } |
2990 | 2990 | ); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | //If the relative URL does not parse, attempt to parse the entire URL. |
25 | 25 | //PHP Known bug ( https://bugs.php.net/bug.php?id=70942 ) |
26 | - $parts = ($parts === false)?parse_url($baseUri):$parts; |
|
26 | + $parts = ($parts === false) ?parse_url($baseUri) : $parts; |
|
27 | 27 | if ($parts === false) { |
28 | 28 | throw new \InvalidArgumentException("Invalid URI $uri"); |
29 | 29 | } |
@@ -46,14 +46,14 @@ discard block |
||
46 | 46 | if ($basePath) { |
47 | 47 | // if it ends with a slash, relative paths are below it |
48 | 48 | if (preg_match('~/$~', $basePath)) { |
49 | - $path = $basePath . $path; |
|
49 | + $path = $basePath.$path; |
|
50 | 50 | } else { |
51 | 51 | // remove double slashes |
52 | 52 | $dir = rtrim(dirname($basePath), '\\/'); |
53 | - $path = $dir . '/' . $path; |
|
53 | + $path = $dir.'/'.$path; |
|
54 | 54 | } |
55 | 55 | } else { |
56 | - $path = '/' . ltrim($path, '/'); |
|
56 | + $path = '/'.ltrim($path, '/'); |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 | $base = $base->withPath($path); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $base = $base->withFragment($parts['fragment']); |
69 | 69 | } |
70 | 70 | |
71 | - return (string) $base; |
|
71 | + return (string)$base; |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
@@ -91,9 +91,9 @@ discard block |
||
91 | 91 | if (!isset($urlParts['host']) or !isset($urlParts['scheme'])) { |
92 | 92 | throw new \InvalidArgumentException("Wrong URL passes, host and scheme not set"); |
93 | 93 | } |
94 | - $host = $urlParts['scheme'] . '://' . $urlParts['host']; |
|
94 | + $host = $urlParts['scheme'].'://'.$urlParts['host']; |
|
95 | 95 | if (isset($urlParts['port'])) { |
96 | - $host .= ':' . $urlParts['port']; |
|
96 | + $host .= ':'.$urlParts['port']; |
|
97 | 97 | } |
98 | 98 | return $host; |
99 | 99 | } |
@@ -104,9 +104,9 @@ discard block |
||
104 | 104 | $cutUrl = (string)$uri->withQuery('')->withFragment(''); |
105 | 105 | |
106 | 106 | if ($path === '' || $path[0] === '#') { |
107 | - return $cutUrl . $path; |
|
107 | + return $cutUrl.$path; |
|
108 | 108 | } |
109 | 109 | |
110 | - return rtrim($cutUrl, '/') . '/' . ltrim($path, '/'); |
|
110 | + return rtrim($cutUrl, '/').'/'.ltrim($path, '/'); |
|
111 | 111 | } |
112 | 112 | } |