Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
GenerateSuiteCommand.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types = 1);
7 
9 
11 use Symfony\Component\Console\Input\InputArgument;
12 use Symfony\Component\Console\Input\InputInterface;
13 use Symfony\Component\Console\Output\OutputInterface;
14 
16 {
22  protected function configure()
23  {
24  $this->setName('generate:suite')
25  ->setDescription('This command generates a single suite based on declaration in xml')
26  ->addArgument(
27  'suites',
28  InputArgument::IS_ARRAY | InputArgument::REQUIRED,
29  'argument which indicates suite names for generation (separated by space)'
30  );
31 
32  parent::configure();
33  }
34 
43  protected function execute(InputInterface $input, OutputInterface $output)
44  {
45  $remove = $input->getOption('remove');
46 
47  // Remove previous GENERATED_DIR if --remove option is used
48  if ($remove) {
49  $this->removeGeneratedDirectory($output, $output->isVerbose());
50  }
51 
52  $suites = $input->getArgument('suites');
53 
54  foreach ($suites as $suite) {
55  SuiteGenerator::getInstance()->generateSuite($suite);
56  if ($output->isVerbose()) {
57  $output->writeLn("suite $suite generated");
58  }
59  }
60 
61  $output->writeLn("Suites Generated");
62  }
63 }
removeGeneratedDirectory(OutputInterface $output, bool $verbose)
execute(InputInterface $input, OutputInterface $output)