0cbf0f8d04ba2abe5d06f2077ffd87483c767eb2
[yaffs-website] / vendor / drupal / console / Test / Command / GeneratorPluginBlockCommandTest.php
1 <?php
2 /**
3  * @file
4  * Contains \Drupal\Console\Test\Command\GeneratorPluginBlockCommandTest.
5  */
6
7 namespace Drupal\Console\Test\Command;
8
9 use Drupal\Console\Command\Generate\PluginBlockCommand;
10 use Symfony\Component\Console\Tester\CommandTester;
11 use Drupal\Console\Test\DataProvider\PluginBlockDataProviderTrait;
12
13 class GeneratorPluginBlockCommandTest extends GenerateCommandTest
14 {
15     use PluginBlockDataProviderTrait;
16     
17     /**
18      * Plugin block generator test
19      *
20      * @param $module
21      * @param $class_name
22      * @param $label
23      * @param $plugin_id
24      *
25      * @dataProvider commandData
26      */
27     public function testGeneratePluginBlock(
28         $module,
29         $class_name,
30         $label,
31         $plugin_id,
32         $services,
33         $inputs
34     ) {
35         $command = new PluginBlockCommand($this->getHelperSet());
36         $command->setHelperSet($this->getHelperSet());
37         $command->setGenerator($this->getGenerator());
38
39         $commandTester = new CommandTester($command);
40
41         $this->markTestIncomplete(
42             'This test has not been implemented yet.'
43         );
44
45         $code = $commandTester->execute(
46             [
47               '--module'         => $module,
48               '--class'     => $class_name,
49               '--label'          => $label,
50               '--plugin-id'      => $plugin_id,
51               '--services'       => $services,
52               '--inputs'         => $inputs
53             ],
54             ['interactive' => false]
55         );
56
57         $this->assertEquals(0, $code);
58     }
59
60     private function getGenerator()
61     {
62         return $this
63             ->getMockBuilder('Drupal\Console\Generator\PluginBlockGenerator')
64             ->disableOriginalConstructor()
65             ->setMethods(['generate'])
66             ->getMock();
67     }
68 }