More tidying.
[yaffs-website] / vendor / drupal / console / Test / Generator / ThemeGeneratorTest.php
1 <?php
2
3 /**
4  * @file
5  * Contains Drupal\Console\Test\Generator\ThemeGeneratorTest.
6  */
7
8 namespace Drupal\Console\Test\Generator;
9
10 use Drupal\Console\Generator\ThemeGenerator;
11 use Drupal\Console\Test\DataProvider\ThemeDataProviderTrait;
12
13 class ThemeGeneratorTest extends GeneratorTest
14 {
15     use ThemeDataProviderTrait;
16
17     /**
18      * Theme generator test
19      *
20      * @param $theme
21      * @param $machine_name
22      * @param $theme_path
23      * @param $description
24      * @param $core
25      * @param $package
26      * @param $global_library
27      * @param $base_theme
28      * @param $regions
29      * @param $breakpoints
30      *
31      * @dataProvider commandData
32      */
33     public function testGenerateTheme(
34         $theme,
35         $machine_name,
36         $theme_path,
37         $description,
38         $core,
39         $package,
40         $global_library,
41         $base_theme,
42         $regions,
43         $breakpoints
44     ) {
45         $generator = new ThemeGenerator();
46         $this->getRenderHelper()->setSkeletonDirs($this->getSkeletonDirs());
47         $this->getRenderHelper()->setTranslator($this->getTranslatorHelper());
48         $generator->setHelperSet($this->getHelperSet());
49
50         $generator->generate(
51             $theme,
52             $machine_name,
53             $theme_path,
54             $description,
55             $core,
56             $package,
57             $global_library,
58             $base_theme,
59             $regions,
60             $breakpoints
61         );
62
63         $files = [
64           $theme_path . '/' . $machine_name . '/' . $machine_name . '.info.yml',
65           $theme_path . '/' . $machine_name .  '/' . $machine_name . '.theme'
66         ];
67
68         foreach ($files as $file) {
69             $this->assertTrue(
70                 file_exists($file),
71                 sprintf('%s does not exist', $file)
72             );
73         }
74
75         if ($breakpoints) {
76             $this->assertTrue(
77                 file_exists($theme_path . '/' . $machine_name . '.breakpoints.yml'),
78                 sprintf('%s does not exist', $machine_name . '.breakpoints.yml')
79             );
80         }
81     }
82 }