diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2015-02-01 04:19:43 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2015-02-01 04:19:43 +0300 |
commit | ccb320fa465c4bf702f955073dd4228a107eae9d (patch) | |
tree | 7989eb88d402e81188106142f95826f42e1ec1e1 /plugins/CoreConsole | |
parent | 6a3e19ac4475a4198a9438d0041dd935aa21404a (diff) |
added possibility to generate a UI test
Diffstat (limited to 'plugins/CoreConsole')
-rw-r--r-- | plugins/CoreConsole/Commands/GenerateTest.php | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/plugins/CoreConsole/Commands/GenerateTest.php b/plugins/CoreConsole/Commands/GenerateTest.php index 6047f2ddc7..ee9b8ee4c7 100644 --- a/plugins/CoreConsole/Commands/GenerateTest.php +++ b/plugins/CoreConsole/Commands/GenerateTest.php @@ -24,7 +24,7 @@ class GenerateTest extends GeneratePluginBase ->setDescription('Adds a test to an existing plugin') ->addOption('pluginname', null, InputOption::VALUE_REQUIRED, 'The name of an existing plugin') ->addOption('testname', null, InputOption::VALUE_REQUIRED, 'The name of the test to create') - ->addOption('testtype', null, InputOption::VALUE_REQUIRED, 'Whether you want to create a "unit", "integration" or "system" test'); + ->addOption('testtype', null, InputOption::VALUE_REQUIRED, 'Whether you want to create a "unit", "integration", "system", or "ui" test'); } protected function execute(InputInterface $input, OutputInterface $output) @@ -37,7 +37,9 @@ class GenerateTest extends GeneratePluginBase $replace = array( 'ExamplePlugin' => $pluginName, 'SimpleTest' => $testName, - 'SimpleSystemTest' => $testName + 'SimpleSystemTest' => $testName, + 'SimpleUITest_spec.js' => $testName . '_spec.js', + 'SimpleUITest' => $testName, ); $whitelistFiles = $this->getTestFilesWhitelist($testType); @@ -108,7 +110,7 @@ class GenerateTest extends GeneratePluginBase public function getValidTypes() { - return array('unit', 'integration', 'system'); + return array('unit', 'integration', 'system', 'ui'); } /** @@ -145,6 +147,17 @@ class GenerateTest extends GeneratePluginBase */ protected function getTestFilesWhitelist($testType) { + if ('Ui' == $testType) { + return array( + '/tests', + '/tests/UI', + '/tests/UI/.gitignore', + '/tests/UI/expected-ui-screenshots', + '/tests/UI/expected-ui-screenshots/.gitkeep', + '/tests/UI/SimpleUITest_spec.js', + ); + } + if ('System' == $testType) { return array( '/.gitignore', |