Security update for Core, with self-updated composer
[yaffs-website] / vendor / drupal / console / Test / Generator / PluginTypeYamlGeneratorTest.php
1 <?php
2 /**
3  * @file
4  * Contains Drupal\Console\Test\Generator\PluginTypeYamlGeneratorTest.
5  */
6
7 namespace Drupal\Console\Test\Generator;
8
9 use Drupal\Console\Generator\PluginTypeYamlGenerator;
10 use Drupal\Console\Test\DataProvider\PluginTypeYamlDataProviderTrait;
11
12 class PluginTypeYamlGeneratorTest extends GeneratorTest
13 {
14     use PluginTypeYamlDataProviderTrait;
15
16     /**
17      * PluginTypeYaml generator test
18      *
19      * @param $module
20      * @param $plugin_class
21      * @param $plugin_name
22      * @param $plugin_file_name
23      *
24      * @dataProvider commandData
25      */
26     public function testGeneratePluginTypeYaml(
27         $module,
28         $plugin_class,
29         $plugin_name,
30         $plugin_file_name
31     ) {
32         $generator = new PluginTypeYamlGenerator();
33         $this->getRenderHelper()->setSkeletonDirs($this->getSkeletonDirs());
34         $this->getRenderHelper()->setTranslator($this->getTranslatorHelper());
35         $generator->setHelperSet($this->getHelperSet());
36
37         $generator->generate(
38             $module,
39             $plugin_class,
40             $plugin_name,
41             $plugin_file_name
42         );
43
44         $files = [
45           $generator->getSite()->getSourcePath($module) . '/' . $plugin_class . 'Manager.php',
46           $generator->getSite()->getSourcePath($module) . '/' . $plugin_class . 'ManagerInterface.php',
47           $generator->getSite()->getModulePath($module) . '/' . $module . '.services.yml',
48           $generator->getSite()->getModulePath($module) . '/' . $module . '.' . $plugin_file_name . '.yml'
49         ];
50
51         foreach ($files as $file) {
52             $this->assertTrue(
53                 file_exists($file),
54                 sprintf('%s does not exist', $file)
55             );
56         }
57     }
58 }