More tidying.
[yaffs-website] / vendor / drupal / console / Test / Generator / PluginConditionGeneratorTest.php
1 <?php
2
3 /**
4  * @file
5  * Contains Drupal\Console\Test\Generator\PluginConditionGeneratorTest.
6  */
7
8 namespace Drupal\Console\Test\Generator;
9
10 use Drupal\Console\Generator\PluginConditionGenerator;
11 use Drupal\Console\Test\DataProvider\PluginConditionDataProviderTrait;
12
13 class PluginConditionGeneratorTest extends GeneratorTest
14 {
15     use PluginConditionDataProviderTrait;
16
17     /**
18      * PluginCondition generator test
19      *
20      * @param $module
21      * @param $class_name
22      * @param $label
23      * @param $plugin_id
24      * @param $context_definition_id
25      * @param $context_definition_label
26      * @param $context_definition_required
27      *
28      * @dataProvider commandData
29      */
30     public function testGeneratePluginCondition(
31         $module,
32         $class_name,
33         $label,
34         $plugin_id,
35         $context_definition_id,
36         $context_definition_label,
37         $context_definition_required
38     ) {
39         $generator = new PluginConditionGenerator();
40         $this->getRenderHelper()->setSkeletonDirs($this->getSkeletonDirs());
41         $this->getRenderHelper()->setTranslator($this->getTranslatorHelper());
42         $generator->setHelperSet($this->getHelperSet());
43
44         $generator->generate(
45             $module,
46             $class_name,
47             $label,
48             $plugin_id,
49             $context_definition_id,
50             $context_definition_label,
51             $context_definition_required
52         );
53
54         $this->assertTrue(
55             file_exists($generator->getSite()->getPluginPath($module, 'Condition') . '/' . $class_name . '.php'),
56             sprintf('%s does not exist', $class_name.'.php')
57         );
58     }
59 }