16
16
use Codeception \SuiteManager ;
17
17
use Codeception \Test \Cept ;
18
18
use Codeception \Util \Debug ;
19
+ use Symfony \Component \Console \Attribute \AsCommand ;
19
20
use Symfony \Component \Console \Command \Command ;
20
21
use Symfony \Component \Console \Input \InputArgument ;
21
22
use Symfony \Component \Console \Input \InputInterface ;
32
33
*
33
34
* * `codecept console acceptance` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
34
35
*/
36
+ #[AsCommand(
37
+ name: 'console ' ,
38
+ description: 'Launches interactive test console '
39
+ )]
35
40
class Console extends Command
36
41
{
37
42
protected ?Cept $ test = null ;
@@ -49,9 +54,9 @@ class Console extends Command
49
54
50
55
protected function configure (): void
51
56
{
52
- $ this -> setDescription ( ' Launches interactive test console ' )
57
+ $ this
53
58
->addArgument ('suite ' , InputArgument::REQUIRED , 'suite to be executed ' )
54
- ->addOption ('colors ' , '' , InputOption::VALUE_NONE , 'Use colors in output ' );
59
+ ->addOption ('colors ' , null , InputOption::VALUE_NONE , 'Use colors in output ' );
55
60
}
56
61
57
62
protected function execute (InputInterface $ input , OutputInterface $ output ): int
@@ -84,7 +89,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
84
89
$ this ->test = new Cept ('' , '' );
85
90
$ this ->test ->getMetadata ()->setServices ([
86
91
'dispatcher ' => $ eventDispatcher ,
87
- 'modules ' => $ moduleContainer
92
+ 'modules ' => $ moduleContainer,
88
93
]);
89
94
90
95
$ scenario = new Scenario ($ this ->test );
0 commit comments