4 * Contains \Drupal\Console\Test\Command\GeneratorPluginTypeYamlCommandTest.
7 namespace Drupal\Console\Test\Command;
9 use Drupal\Console\Command\Generate\PluginTypeYamlCommand;
10 use Symfony\Component\Console\Tester\CommandTester;
11 use Drupal\Console\Test\DataProvider\PluginTypeYamlDataProviderTrait;
13 class GeneratorPluginTypeYamlCommandTest extends GenerateCommandTest
15 use PluginTypeYamlDataProviderTrait;
18 * Plugin type yaml generator test
21 * @param $plugin_class
23 * @param $plugin_file_name
25 * @dataProvider commandData
27 public function testGeneratePluginTypeYaml(
33 $command = new PluginTypeYamlCommand($this->getHelperSet());
34 $command->setHelperSet($this->getHelperSet());
35 $command->setGenerator($this->getGenerator());
37 $commandTester = new CommandTester($command);
39 $code = $commandTester->execute(
41 '--module' => $module,
42 '--class' => $plugin_class,
43 '--plugin-name' => $plugin_name,
44 '--plugin-file-name' => $plugin_file_name
46 ['interactive' => false]
49 $this->assertEquals(0, $code);
52 private function getGenerator()
55 ->getMockBuilder('Drupal\Console\Generator\PluginTypeYamlGenerator')
56 ->disableOriginalConstructor()
57 ->setMethods(['generate'])