14
14
use Magento \FunctionalTestingFramework \Util \Manifest \ParallelTestManifest ;
15
15
use Magento \FunctionalTestingFramework \Util \Manifest \TestManifestFactory ;
16
16
use Magento \FunctionalTestingFramework \Util \TestGenerator ;
17
- use Symfony \Component \Console \Command \Command ;
18
17
use Symfony \Component \Console \Input \InputArgument ;
19
18
use Symfony \Component \Console \Input \InputInterface ;
20
19
use Symfony \Component \Console \Input \InputOption ;
21
20
use Symfony \Component \Console \Output \OutputInterface ;
22
21
23
- class GenerateTestsCommand extends Command
22
+ class GenerateTestsCommand extends BaseGenerateCommand
24
23
{
25
24
/**
26
25
* Configures the current command.
@@ -52,7 +51,14 @@ protected function configure()
52
51
't ' ,
53
52
InputOption::VALUE_REQUIRED ,
54
53
'A parameter accepting a JSON string used to determine the test configuration '
55
- )->addOption ('debug ' , 'd ' , InputOption::VALUE_NONE , 'run extra validation when generating tests ' );
54
+ )->addOption (
55
+ 'debug ' ,
56
+ 'd ' ,
57
+ InputOption::VALUE_NONE ,
58
+ 'run extra validation when generating tests '
59
+ );
60
+
61
+ parent ::configure ();
56
62
}
57
63
58
64
/**
@@ -73,6 +79,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
73
79
$ force = $ input ->getOption ('force ' );
74
80
$ time = $ input ->getOption ('time ' ) * 60 * 1000 ; // convert from minutes to milliseconds
75
81
$ debug = $ input ->getOption ('debug ' );
82
+ $ remove = $ input ->getOption ('remove ' );
83
+
76
84
$ verbose = $ output ->isVerbose ();
77
85
78
86
if ($ json !== null && !json_decode ($ json )) {
@@ -85,6 +93,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
85
93
throw new TestFrameworkException ("time option cannot be less than or equal to 0 " );
86
94
}
87
95
96
+ // Remove previous GENERATED_DIR if --remove option is used
97
+ if ($ remove ) {
98
+ $ this ->removeGeneratedDirectory ($ output , $ verbose || $ debug );
99
+ }
100
+
88
101
$ testConfiguration = $ this ->createTestConfiguration ($ json , $ tests , $ force , $ debug , $ verbose );
89
102
90
103
// create our manifest file here
@@ -153,7 +166,6 @@ private function createTestConfiguration($json, array $tests, bool $force, bool
153
166
*
154
167
* @param string $json
155
168
* @param array $testConfiguration
156
- * @throws TestFrameworkException
157
169
* @return array
158
170
*/
159
171
private function parseTestsConfigJson ($ json , array $ testConfiguration )
0 commit comments