3 namespace DrupalCodeGenerator\Command\Drupal_8\Test;
5 use DrupalCodeGenerator\Command\BaseGenerator;
6 use DrupalCodeGenerator\Utils;
7 use Symfony\Component\Console\Input\InputInterface;
8 use Symfony\Component\Console\Output\OutputInterface;
9 use Symfony\Component\Console\Question\Question;
12 * Implements d8:test:web command.
14 class Web extends BaseGenerator {
16 protected $name = 'd8:test:web';
17 protected $description = 'Generates a web based test';
18 protected $alias = 'web-test';
19 protected $label = 'Web (simpletest)';
24 protected function interact(InputInterface $input, OutputInterface $output) {
25 $questions = Utils::defaultQuestions();
26 $questions['class'] = new Question('Class', 'ExampleTest');
27 $questions['class']->setValidator([Utils::class, 'validateClassName']);
29 $this->collectVars($input, $output, $questions);
32 ->path('src/Tests/{class}.php')
33 ->template('d8/test/web.twig');