Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / chi-teck / drupal-code-generator / src / Command / Drupal_8 / Test / WebDriver.php
1 <?php
2
3 namespace DrupalCodeGenerator\Command\Drupal_8\Test;
4
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;
10
11 /**
12  * Implements d8:test:webdriver command.
13  */
14 class WebDriver extends BaseGenerator {
15
16   protected $name = 'd8:test:webdriver';
17   protected $description = 'Generates a test that supports JavaScript';
18   protected $alias = 'webdriver-test';
19   protected $label = 'WebDriver';
20
21   /**
22    * {@inheritdoc}
23    */
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']);
28
29     $this->collectVars($input, $output, $questions);
30
31     $this->addFile()
32       ->path('tests/src/FunctionalJavascript/{class}.php')
33       ->template('d8/test/webdriver.twig');
34   }
35
36 }