@@ -70,12 +70,12 @@ |
||
| 70 | 70 | { |
| 71 | 71 | public function addSwitches(CliCommand $command, $injectables) |
| 72 | 72 | { |
| 73 | - // no-op |
|
| 73 | + // no-op |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | public function initBeforeModulesAvailable(CliEngine $engine, CliCommand $command, Injectables $injectables) |
| 77 | 77 | { |
| 78 | - $injectables->initProseLoaderSupport($injectables); |
|
| 78 | + $injectables->initProseLoaderSupport($injectables); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | public function initAfterModulesAvailable(StoryTeller $st, CliEngine $engine, Injectables $injectables) |
@@ -72,8 +72,8 @@ discard block |
||
| 72 | 72 | { |
| 73 | 73 | $command->addSwitches([ |
| 74 | 74 | new Feature_SystemUnderTestConfigSwitch( |
| 75 | - $injectables->knownSystemsUnderTestList, |
|
| 76 | - $injectables->defaultSystemUnderTestName |
|
| 75 | + $injectables->knownSystemsUnderTestList, |
|
| 76 | + $injectables->defaultSystemUnderTestName |
|
| 77 | 77 | ) |
| 78 | 78 | ]); |
| 79 | 79 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | throw new E4xx_NoSystemUnderTestSpecified(); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - $injectables->initActiveSystemUnderTestConfigSupport( |
|
| 87 | + $injectables->initActiveSystemUnderTestConfigSupport( |
|
| 88 | 88 | $engine->options->sutName, |
| 89 | 89 | $injectables |
| 90 | 90 | ); |
@@ -98,11 +98,11 @@ |
||
| 98 | 98 | |
| 99 | 99 | // what is the required argument? |
| 100 | 100 | $requiredArgMsg = "the system-under-test to test; one of:" . PHP_EOL . PHP_EOL; |
| 101 | - foreach($sutList->getEntryNames() as $sutName) { |
|
| 101 | + foreach ($sutList->getEntryNames() as $sutName) { |
|
| 102 | 102 | $requiredArgMsg .= "* $sutName" . PHP_EOL; |
| 103 | 103 | } |
| 104 | 104 | if ($defaultSutName) { |
| 105 | - $requiredArgMsg .= PHP_EOL. ' '; |
|
| 105 | + $requiredArgMsg .= PHP_EOL . ' '; |
|
| 106 | 106 | } |
| 107 | 107 | $this->setRequiredArg('<system-under-test>', $requiredArgMsg); |
| 108 | 108 | $this->setArgValidator(new Feature_SystemUnderTestConfigValidator($sutList, $defaultSutName)); |
@@ -72,15 +72,15 @@ |
||
| 72 | 72 | { |
| 73 | 73 | $command->addSwitches([ |
| 74 | 74 | new Feature_TestEnvironmentConfigSwitch( |
| 75 | - $injectables->knownTestEnvironmentsList, |
|
| 76 | - $injectables->defaultTestEnvironmentName |
|
| 75 | + $injectables->knownTestEnvironmentsList, |
|
| 76 | + $injectables->defaultTestEnvironmentName |
|
| 77 | 77 | ) |
| 78 | 78 | ]); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | public function initBeforeModulesAvailable(CliEngine $engine, CliCommand $command, Injectables $injectables) |
| 82 | 82 | { |
| 83 | - $injectables->initActiveTestEnvironmentConfigSupport( |
|
| 83 | + $injectables->initActiveTestEnvironmentConfigSupport( |
|
| 84 | 84 | $engine->options->testEnvironmentName, |
| 85 | 85 | $injectables |
| 86 | 86 | ); |
@@ -94,10 +94,10 @@ |
||
| 94 | 94 | |
| 95 | 95 | // what is the required argument? |
| 96 | 96 | $requiredArgMsg = "the environment to test against; one of:" . PHP_EOL . PHP_EOL; |
| 97 | - foreach($envList->getEntryNames() as $envName) { |
|
| 97 | + foreach ($envList->getEntryNames() as $envName) { |
|
| 98 | 98 | $requiredArgMsg .= "* $envName" . PHP_EOL; |
| 99 | 99 | } |
| 100 | - $requiredArgMsg .= PHP_EOL. ' '; |
|
| 100 | + $requiredArgMsg .= PHP_EOL . ' '; |
|
| 101 | 101 | $this->setRequiredArg('<environment>', $requiredArgMsg); |
| 102 | 102 | $this->setArgValidator(new Feature_TestEnvironmentConfigValidator($envList, $defaultEnvName)); |
| 103 | 103 | $this->setArgHasDefaultValueOf($defaultEnvName); |
@@ -112,8 +112,7 @@ |
||
| 112 | 112 | if (isset($engine->options->readOnlyTestUsers) && $engine->options->readOnlyTestUsers) { |
| 113 | 113 | usingUsers()->setUsersFileIsReadOnly(); |
| 114 | 114 | } |
| 115 | - else |
|
| 116 | - { |
|
| 115 | + else { |
|
| 117 | 116 | $setting = fromTestEnvironment()->getModuleSetting("users.readOnly"); |
| 118 | 117 | if ($setting === true) { |
| 119 | 118 | usingUsers()->setUsersFileIsReadOnly(); |
@@ -123,43 +123,43 @@ |
||
| 123 | 123 | $downloader = new FileDownloader(); |
| 124 | 124 | |
| 125 | 125 | // let's get the files downloaded |
| 126 | - foreach ($filesToDownload as $file){ |
|
| 126 | + foreach ($filesToDownload as $file) { |
|
| 127 | 127 | |
| 128 | - if (!is_object($file->url)){ |
|
| 128 | + if (!is_object($file->url)) { |
|
| 129 | 129 | $url = $file->url; |
| 130 | 130 | } else { |
| 131 | 131 | $platform = strtolower(php_uname("s") . '/' . php_uname("m")); |
| 132 | - if (isset($file->url->{$platform})){ |
|
| 132 | + if (isset($file->url->{$platform})) { |
|
| 133 | 133 | $url = $file->url->{$platform}; |
| 134 | - } else if (isset($file->url->generic)){ |
|
| 135 | - $url = $file->url->generic; |
|
| 134 | + } else if (isset($file->url->generic)) { |
|
| 135 | + $url = $file->url->generic; |
|
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | - if (!isset($url)){ |
|
| 140 | - throw new Exception("No supported downloads for ".$file->name); |
|
| 139 | + if (!isset($url)) { |
|
| 140 | + throw new Exception("No supported downloads for " . $file->name); |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | // How big is the file? |
| 144 | 144 | // via http://www.php.net/manual/en/function.filesize.php#84130 |
| 145 | - $headers = array_change_key_case(get_headers($url, 1),CASE_LOWER); |
|
| 146 | - if ( !preg_match('/HTTP\/1\.(0|1) 200 OK/', $headers[0] ) ) { |
|
| 145 | + $headers = array_change_key_case(get_headers($url, 1), CASE_LOWER); |
|
| 146 | + if (!preg_match('/HTTP\/1\.(0|1) 200 OK/', $headers[0])) { |
|
| 147 | 147 | $fileSize = $headers['content-length'][1]; |
| 148 | 148 | } else { |
| 149 | 149 | $fileSize = $headers['content-length']; |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | // Update the user on what's going on |
| 153 | - echo "Downloading: " . $url.' ('.round($fileSize/1024/1024, 3).'mb)'.PHP_EOL; |
|
| 153 | + echo "Downloading: " . $url . ' (' . round($fileSize / 1024 / 1024, 3) . 'mb)' . PHP_EOL; |
|
| 154 | 154 | |
| 155 | 155 | // Download it |
| 156 | 156 | $fileBase = basename($url); |
| 157 | - $downloader->download($url, "./vendor/bin/".$fileBase); |
|
| 157 | + $downloader->download($url, "./vendor/bin/" . $fileBase); |
|
| 158 | 158 | |
| 159 | 159 | // Make sure that the relevant files are executable |
| 160 | 160 | if (isset($file->makeExecutable)) { |
| 161 | - foreach ($file->makeExecutable as $exec){ |
|
| 162 | - chmod("./vendor/bin/".$exec, 0755); |
|
| 161 | + foreach ($file->makeExecutable as $exec) { |
|
| 162 | + chmod("./vendor/bin/" . $exec, 0755); |
|
| 163 | 163 | } |
| 164 | 164 | } |
| 165 | 165 | } |
@@ -123,20 +123,22 @@ discard block |
||
| 123 | 123 | $downloader = new FileDownloader(); |
| 124 | 124 | |
| 125 | 125 | // let's get the files downloaded |
| 126 | - foreach ($filesToDownload as $file){ |
|
| 126 | + foreach ($filesToDownload as $file) { |
|
| 127 | 127 | |
| 128 | - if (!is_object($file->url)){ |
|
| 128 | + if (!is_object($file->url)) { |
|
| 129 | 129 | $url = $file->url; |
| 130 | - } else { |
|
| 130 | + } |
|
| 131 | + else { |
|
| 131 | 132 | $platform = strtolower(php_uname("s") . '/' . php_uname("m")); |
| 132 | - if (isset($file->url->{$platform})){ |
|
| 133 | + if (isset($file->url->{$platform})) { |
|
| 133 | 134 | $url = $file->url->{$platform}; |
| 134 | - } else if (isset($file->url->generic)){ |
|
| 135 | + } |
|
| 136 | + else if (isset($file->url->generic)) { |
|
| 135 | 137 | $url = $file->url->generic; |
| 136 | 138 | } |
| 137 | 139 | } |
| 138 | 140 | |
| 139 | - if (!isset($url)){ |
|
| 141 | + if (!isset($url)) { |
|
| 140 | 142 | throw new Exception("No supported downloads for ".$file->name); |
| 141 | 143 | } |
| 142 | 144 | |
@@ -145,7 +147,8 @@ discard block |
||
| 145 | 147 | $headers = array_change_key_case(get_headers($url, 1),CASE_LOWER); |
| 146 | 148 | if ( !preg_match('/HTTP\/1\.(0|1) 200 OK/', $headers[0] ) ) { |
| 147 | 149 | $fileSize = $headers['content-length'][1]; |
| 148 | - } else { |
|
| 150 | + } |
|
| 151 | + else { |
|
| 149 | 152 | $fileSize = $headers['content-length']; |
| 150 | 153 | } |
| 151 | 154 | |
@@ -158,7 +161,7 @@ discard block |
||
| 158 | 161 | |
| 159 | 162 | // Make sure that the relevant files are executable |
| 160 | 163 | if (isset($file->makeExecutable)) { |
| 161 | - foreach ($file->makeExecutable as $exec){ |
|
| 164 | + foreach ($file->makeExecutable as $exec) { |
|
| 162 | 165 | chmod("./vendor/bin/".$exec, 0755); |
| 163 | 166 | } |
| 164 | 167 | } |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | $this->setLongDescription( |
| 68 | 68 | "Use this command to get a list of all of the machines (physical or VM)" |
| 69 | 69 | . " that are currently listed in Storyplayer's hoststable." |
| 70 | - .PHP_EOL .PHP_EOL |
|
| 70 | + .PHP_EOL . PHP_EOL |
|
| 71 | 71 | ."This can help you to identify VMs that have been left running after " |
| 72 | 72 | ."a test has completed." |
| 73 | 73 | .PHP_EOL |
@@ -67,10 +67,10 @@ |
||
| 67 | 67 | $this->setLongDesc( |
| 68 | 68 | "Use this command to get a list of all of the processes that Storyplayer " |
| 69 | 69 | ."has started in the background." |
| 70 | - .PHP_EOL .PHP_EOL |
|
| 70 | + .PHP_EOL . PHP_EOL |
|
| 71 | 71 | ."This can help you to identify processes that have been left running after " |
| 72 | 72 | ."a test has completed." |
| 73 | - .PHP_EOL .PHP_EOL |
|
| 73 | + .PHP_EOL . PHP_EOL |
|
| 74 | 74 | ."You can use the '--kill-processes' switch to stop these processes." |
| 75 | 75 | ); |
| 76 | 76 | |