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