1 | <?php |
||
20 | class GenerateSetup extends BaseCommand |
||
21 | { |
||
22 | |||
23 | /** |
||
24 | * The console command name. |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $name = 'setup'; |
||
29 | |||
30 | /** |
||
31 | * The console command description. |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $description = 'Setting up Codeception testing for the first time'; |
||
36 | |||
37 | /** |
||
38 | * Execute the console command. |
||
39 | * |
||
40 | * @return void |
||
41 | */ |
||
42 | public function handle() |
||
43 | { |
||
44 | /** |
||
45 | * @var string $moduleName |
||
46 | */ |
||
47 | $moduleName = $this->argument('moduleName'); |
||
48 | $this->info("Creating testing setup for '{$moduleName}'."); |
||
49 | |||
50 | $setup = new Setup($moduleName); |
||
51 | $generator = new SetupGenerator($setup); |
||
52 | |||
53 | // TODO: Get default suites from Laravel config |
||
54 | $defaultSuites = ['Unit', 'Integration', 'GraphQL', 'Acceptance']; |
||
55 | |||
56 | $suites = $this->getOption('suites', $defaultSuites); |
||
57 | |||
58 | $suiteCount = count($suites); |
||
59 | $suiteText = Str::plural('suite', $suiteCount); |
||
60 | |||
61 | $this->info("Generating {$suiteCount} {$suiteText}: '" . implode("', '", $suites) . "'"); |
||
62 | $generator->generate($suites); |
||
|
|||
63 | |||
64 | $this->info("Done! Go create some tests!"); |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * @return CommandArguments |
||
69 | */ |
||
70 | protected function provideArguments() : CommandArguments |
||
77 | } |
||
78 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: