Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / src / Command / Drupal_7 / Test.php
diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/Test.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/Test.php
new file mode 100644 (file)
index 0000000..c32fef7
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+
+namespace DrupalCodeGenerator\Command\Drupal_7;
+
+use DrupalCodeGenerator\Command\BaseGenerator;
+use DrupalCodeGenerator\Utils;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Question\Question;
+
+/**
+ * Implements d7:test command.
+ */
+class Test extends BaseGenerator {
+
+  protected $name = 'd7:test';
+  protected $description = 'Generates Drupal 7 test case';
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function interact(InputInterface $input, OutputInterface $output) {
+    $questions = Utils::defaultQuestions();
+    $default_class = function ($vars) {
+      return Utils::camelize($vars['machine_name']) . 'TestCase';
+    };
+    $questions['class'] = new Question('Class', $default_class);
+
+    $this->collectVars($input, $output, $questions);
+
+    $this->addFile()
+      ->path('{machine_name}.test')
+      ->template('d7/test.twig');
+  }
+
+}