6 declare(strict_types = 1);
10 use Symfony\Component\Console\Input\ArrayInput;
11 use Symfony\Component\Console\Input\InputArgument;
12 use Symfony\Component\Console\Input\InputInterface;
13 use Symfony\Component\Console\Input\InputOption;
14 use Symfony\Component\Console\Output\OutputInterface;
15 use Symfony\Component\Process\Process;
27 $this->setName(
"run:test")
28 ->setDescription(
"generation and execution of test(s) defined in xml")
31 InputArgument::REQUIRED | InputArgument::IS_ARRAY,
32 "name of tests to generate and execute" 33 )->addOption(
'skip-generate',
'k', InputOption::VALUE_NONE,
"skip generation and execute existing test")
37 InputOption::VALUE_NONE,
38 'force generation of tests regardless of Magento Instance Configuration' 56 $tests = $input->getArgument(
'name');
57 $skipGeneration = $input->getOption(
'skip-generate');
58 $force = $input->getOption(
'force');
59 $remove = $input->getOption(
'remove');
61 if ($skipGeneration and $remove) {
64 "\"skip-generate\" and \"remove\" options can not be used at the same time." 68 if (!$skipGeneration) {
69 $command = $this->getApplication()->find(
'generate:tests');
71 '--tests' => json_encode([
78 $command->run(
new ArrayInput($args),
$output);
82 $codeceptionCommand = realpath(
PROJECT_ROOT .
'/vendor/bin/codecept') .
" run functional --verbose --steps";
84 $process =
new Process($codeceptionCommand);
85 $process->setWorkingDirectory(TESTS_BP);
86 $process->setIdleTimeout(600);
87 $process->setTimeout(0);
execute(InputInterface $input, OutputInterface $output)