@@ -54,10 +54,10 @@ |
||
54 | 54 | { |
55 | 55 | $actor = $this->settings['actor']; |
56 | 56 | if ($this->settings['namespace']) { |
57 | - $actor = $this->settings['namespace'] . '\\' . $actor; |
|
57 | + $actor = $this->settings['namespace'].'\\'.$actor; |
|
58 | 58 | } |
59 | 59 | |
60 | - $ns = $this->getNamespaceHeader($this->settings['namespace'] . '\\' . $this->name); |
|
60 | + $ns = $this->getNamespaceHeader($this->settings['namespace'].'\\'.$this->name); |
|
61 | 61 | |
62 | 62 | $tester = ''; |
63 | 63 | if ($this->settings['actor']) { |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | */ |
303 | 303 | public function amBearerAuthenticated($accessToken) |
304 | 304 | { |
305 | - $this->haveHttpHeader('Authorization', 'Bearer ' . $accessToken); |
|
305 | + $this->haveHttpHeader('Authorization', 'Bearer '.$accessToken); |
|
306 | 306 | } |
307 | 307 | |
308 | 308 | /** |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | $linkEntry, |
525 | 525 | 'linkEntry should contain property "link-param"' |
526 | 526 | ); |
527 | - $values[] = $linkEntry['uri'] . '; ' . $linkEntry['link-param']; |
|
527 | + $values[] = $linkEntry['uri'].'; '.$linkEntry['link-param']; |
|
528 | 528 | } |
529 | 529 | |
530 | 530 | $this->haveHttpHeader('Link', implode(', ', $values)); |
@@ -568,9 +568,9 @@ discard block |
||
568 | 568 | { |
569 | 569 | // allow full url to be requested |
570 | 570 | if (strpos($url, '://') === false) { |
571 | - $url = $this->config['url'] . $url; |
|
571 | + $url = $this->config['url'].$url; |
|
572 | 572 | if ($this->config['url'] && strpos($url, '://') === false && $this->config['url'][0] !== '/') { |
573 | - $url = '/' . $url; |
|
573 | + $url = '/'.$url; |
|
574 | 574 | } |
575 | 575 | } |
576 | 576 | |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | $this->debugSection("Request", "$method $url"); |
592 | 592 | $files = []; |
593 | 593 | } else { |
594 | - $this->debugSection("Request", "$method $url " . json_encode($parameters)); |
|
594 | + $this->debugSection("Request", "$method $url ".json_encode($parameters)); |
|
595 | 595 | $files = $this->formatFilesArray($files); |
596 | 596 | } |
597 | 597 | $this->response = (string)$this->connectionModule->_request($method, $url, $parameters, $files); |
@@ -600,7 +600,7 @@ discard block |
||
600 | 600 | if ($this->isBinaryData($requestData)) { |
601 | 601 | $requestData = $this->binaryToDebugString($requestData); |
602 | 602 | } |
603 | - $this->debugSection("Request", "$method $url " . $requestData); |
|
603 | + $this->debugSection("Request", "$method $url ".$requestData); |
|
604 | 604 | $this->response = (string)$this->connectionModule->_request($method, $url, [], $files, [], $parameters); |
605 | 605 | } |
606 | 606 | $printedResponse = $this->response; |
@@ -629,7 +629,7 @@ discard block |
||
629 | 629 | */ |
630 | 630 | protected function binaryToDebugString($data) |
631 | 631 | { |
632 | - return '[binary-data length:' . strlen($data) . ' md5:' . md5($data) . ']'; |
|
632 | + return '[binary-data length:'.strlen($data).' md5:'.md5($data).']'; |
|
633 | 633 | } |
634 | 634 | |
635 | 635 | protected function encodeApplicationJson($method, $parameters) |
@@ -894,7 +894,7 @@ discard block |
||
894 | 894 | $this->assertGreaterThan( |
895 | 895 | 0, |
896 | 896 | (new JsonArray($response))->filterByXPath($xpath)->length, |
897 | - "Received JSON did not match the XPath `$xpath`.\nJson Response: \n" . $response |
|
897 | + "Received JSON did not match the XPath `$xpath`.\nJson Response: \n".$response |
|
898 | 898 | ); |
899 | 899 | } |
900 | 900 | |
@@ -910,7 +910,7 @@ discard block |
||
910 | 910 | $this->assertEquals( |
911 | 911 | 0, |
912 | 912 | (new JsonArray($response))->filterByXPath($xpath)->length, |
913 | - "Received JSON matched the XPath `$xpath`.\nJson Response: \n" . $response |
|
913 | + "Received JSON matched the XPath `$xpath`.\nJson Response: \n".$response |
|
914 | 914 | ); |
915 | 915 | } |
916 | 916 | |
@@ -964,7 +964,7 @@ discard block |
||
964 | 964 | $response = $this->connectionModule->_getResponseContent(); |
965 | 965 | $this->assertNotEmpty( |
966 | 966 | (new JsonArray($response))->filterByJsonPath($jsonPath), |
967 | - "Received JSON did not match the JsonPath `$jsonPath`.\nJson Response: \n" . $response |
|
967 | + "Received JSON did not match the JsonPath `$jsonPath`.\nJson Response: \n".$response |
|
968 | 968 | ); |
969 | 969 | } |
970 | 970 | |
@@ -979,7 +979,7 @@ discard block |
||
979 | 979 | $response = $this->connectionModule->_getResponseContent(); |
980 | 980 | $this->assertEmpty( |
981 | 981 | (new JsonArray($response))->filterByJsonPath($jsonPath), |
982 | - "Received JSON matched the JsonPath `$jsonPath`.\nJson Response: \n" . $response |
|
982 | + "Received JSON matched the JsonPath `$jsonPath`.\nJson Response: \n".$response |
|
983 | 983 | ); |
984 | 984 | } |
985 | 985 | |
@@ -995,8 +995,8 @@ discard block |
||
995 | 995 | $this->assertFalse( |
996 | 996 | $jsonResponseArray->containsArray($json), |
997 | 997 | "Response JSON contains provided JSON\n" |
998 | - . "- <info>" . var_export($json, true) . "</info>\n" |
|
999 | - . "+ " . var_export($jsonResponseArray->toArray(), true) |
|
998 | + . "- <info>".var_export($json, true)."</info>\n" |
|
999 | + . "+ ".var_export($jsonResponseArray->toArray(), true) |
|
1000 | 1000 | ); |
1001 | 1001 | } |
1002 | 1002 |
@@ -28,6 +28,9 @@ |
||
28 | 28 | $this->tests = $queue; |
29 | 29 | } |
30 | 30 | |
31 | + /** |
|
32 | + * @param \PHPUnit\Framework\TestCase $test |
|
33 | + */ |
|
31 | 34 | protected function getDependencies($test) |
32 | 35 | { |
33 | 36 | if (!$test instanceof Dependent) { |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * Provides a test file name relative to Codeception root |
63 | 63 | * |
64 | 64 | * @param \PHPUnit\Framework\SelfDescribing $testCase |
65 | - * @return mixed |
|
65 | + * @return string |
|
66 | 66 | */ |
67 | 67 | public static function getTestFileName(\PHPUnit\Framework\SelfDescribing $testCase) |
68 | 68 | { |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | /** |
76 | 76 | * @param \PHPUnit\Framework\SelfDescribing $testCase |
77 | - * @return mixed|string |
|
77 | + * @return string |
|
78 | 78 | */ |
79 | 79 | public static function getTestFullName(\PHPUnit\Framework\SelfDescribing $testCase) |
80 | 80 | { |
@@ -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 | /** |
@@ -11,18 +11,18 @@ discard block |
||
11 | 11 | //require package/bin instead of codecept to avoid printing hashbang line |
12 | 12 | require './vendor/codeception/codeception/package/bin'; |
13 | 13 | die; |
14 | -} elseif (file_exists(__DIR__ . '/vendor/autoload.php')) { |
|
14 | +} elseif (file_exists(__DIR__.'/vendor/autoload.php')) { |
|
15 | 15 | // for phar |
16 | - require_once(__DIR__ . '/vendor/autoload.php'); |
|
17 | -} elseif (file_exists(__DIR__ . '/../../autoload.php')) { |
|
16 | + require_once(__DIR__.'/vendor/autoload.php'); |
|
17 | +} elseif (file_exists(__DIR__.'/../../autoload.php')) { |
|
18 | 18 | //for composer |
19 | - require_once __DIR__ . '/../../autoload.php'; |
|
19 | + require_once __DIR__.'/../../autoload.php'; |
|
20 | 20 | } |
21 | 21 | unset($autoloadFile); |
22 | 22 | |
23 | 23 | // @codingStandardsIgnoreStart |
24 | 24 | |
25 | -include_once __DIR__ . DIRECTORY_SEPARATOR . 'shim.php'; |
|
25 | +include_once __DIR__.DIRECTORY_SEPARATOR.'shim.php'; |
|
26 | 26 | // compat |
27 | 27 | if (PHP_MAJOR_VERSION < 7) { |
28 | 28 | if (false === interface_exists('Throwable', false)) { |
@@ -66,28 +66,28 @@ discard block |
||
66 | 66 | if (!function_exists('codecept_root_dir')) { |
67 | 67 | function codecept_root_dir($appendPath = '') |
68 | 68 | { |
69 | - return \Codeception\Configuration::projectDir() . $appendPath; |
|
69 | + return \Codeception\Configuration::projectDir().$appendPath; |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 | |
73 | 73 | if (!function_exists('codecept_output_dir')) { |
74 | 74 | function codecept_output_dir($appendPath = '') |
75 | 75 | { |
76 | - return \Codeception\Configuration::outputDir() . $appendPath; |
|
76 | + return \Codeception\Configuration::outputDir().$appendPath; |
|
77 | 77 | } |
78 | 78 | } |
79 | 79 | |
80 | 80 | if (!function_exists('codecept_log_dir')) { |
81 | 81 | function codecept_log_dir($appendPath = '') |
82 | 82 | { |
83 | - return \Codeception\Configuration::outputDir() . $appendPath; |
|
83 | + return \Codeception\Configuration::outputDir().$appendPath; |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 | |
87 | 87 | if (!function_exists('codecept_data_dir')) { |
88 | 88 | function codecept_data_dir($appendPath = '') |
89 | 89 | { |
90 | - return \Codeception\Configuration::dataDir() . $appendPath; |
|
90 | + return \Codeception\Configuration::dataDir().$appendPath; |
|
91 | 91 | } |
92 | 92 | } |
93 | 93 |
@@ -16,7 +16,7 @@ |
||
16 | 16 | $not = ''; |
17 | 17 | } |
18 | 18 | |
19 | - call_user_func_array(['\PHPUnit\Framework\Assert', 'assert' . $not . $method], $arguments); |
|
19 | + call_user_func_array(['\PHPUnit\Framework\Assert', 'assert'.$not.$method], $arguments); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | protected function assertNot($arguments) |
@@ -50,7 +50,7 @@ |
||
50 | 50 | \PHPUnit\Framework\Assert::fail("$command can't be executed"); |
51 | 51 | } |
52 | 52 | if ($resultCode !== 0 && $failNonZero) { |
53 | - \PHPUnit\Framework\Assert::fail("Result code was $resultCode.\n\n" . $this->output); |
|
53 | + \PHPUnit\Framework\Assert::fail("Result code was $resultCode.\n\n".$this->output); |
|
54 | 54 | } |
55 | 55 | $this->debug(preg_replace('~s/\e\[\d+(?>(;\d+)*)m//g~', '', $this->output)); |
56 | 56 | } |
@@ -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 | } |