4 * Contains \Drupal\Console\Test\Command\GeneratorPluginTypeAnnotationCommandTest.
7 namespace Drupal\Console\Test\Command;
9 use Drupal\Console\Command\Generate\PluginTypeAnnotationCommand;
10 use Symfony\Component\Console\Tester\CommandTester;
11 use Drupal\Console\Test\DataProvider\PluginTypeYamlDataProviderTrait;
13 class GeneratorPluginTypeAnnotationCommandTest extends GenerateCommandTest
15 use PluginTypeYamlDataProviderTrait;
18 * Plugin type yaml generator test
22 * @param $machine_name
25 * @dataProvider commandData
27 public function testGeneratePluginTypeYaml(
33 $command = new PluginTypeAnnotationCommand($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' => $class_name,
43 '--machine-name' => $machine_name,
46 ['interactive' => false]
49 $this->assertEquals(0, $code);
52 private function getGenerator()
55 ->getMockBuilder('Drupal\Console\Generator\PluginTypeYamlGenerator')
56 ->disableOriginalConstructor()
57 ->setMethods(['generate'])