More tidying.
[yaffs-website] / vendor / drupal / console / Test / Generator / PluginRulesActionGeneratorTest.php
1 <?php
2 /**
3  * @file
4  * Contains Drupal\Console\Test\Generator\PluginRulesActionGeneratorTest.
5  */
6
7 namespace Drupal\Console\Test\Generator;
8
9 use Drupal\Console\Generator\PluginRulesActionGenerator;
10 use Drupal\Console\Test\DataProvider\PluginRulesActionDataProviderTrait;
11
12 class PluginRulesActionGeneratorTest extends GeneratorTest
13 {
14     use PluginRulesActionDataProviderTrait;
15
16     /**
17      * PluginRulesAction generator test
18      *
19      * @param $module
20      * @param $class_name
21      * @param $label
22      * @param $plugin_id
23      * @param $category
24      * @param $context,
25      * @param $type
26      *
27      * @dataProvider commandData
28      */
29     public function testGeneratePluginRulesAction(
30         $module,
31         $class_name,
32         $label,
33         $plugin_id,
34         $category,
35         $context,
36         $type
37     ) {
38         $generator = new PluginRulesActionGenerator();
39         $this->getRenderHelper()->setSkeletonDirs($this->getSkeletonDirs());
40         $this->getRenderHelper()->setTranslator($this->getTranslatorHelper());
41         $generator->setHelperSet($this->getHelperSet());
42
43         $generator->generate(
44             $module,
45             $class_name,
46             $label,
47             $plugin_id,
48             $category,
49             $context,
50             $type
51         );
52
53         $files = [
54           $generator->getSite()->getPluginPath($module, 'Action').'/'.$class_name.'.php',
55           $generator->getSite()->getModulePath($module).'/config/install/system.action.'.$plugin_id.'.yml'
56         ];
57
58         foreach ($files as $file) {
59             $this->assertTrue(
60                 file_exists($file),
61                 sprintf('%s does not exist', $file)
62             );
63         }
64     }
65 }