Security update for Core, with self-updated composer
[yaffs-website] / vendor / drupal / console / Test / Command / GeneratorThemeCommandTest.php
1 <?php
2 /**
3  * @file
4  * Contains Drupal\Console\Test\Command\GeneratorThemeCommandTest.
5  */
6
7 namespace Drupal\Console\Test\Command;
8
9 use Drupal\Console\Command\Generate\ThemeCommand;
10 use Symfony\Component\Console\Tester\CommandTester;
11 use Drupal\Console\Test\DataProvider\ThemeDataProviderTrait;
12
13 class GeneratorThemeCommandTest extends GenerateCommandTest
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         $command = new ThemeCommand($this->getHelperSet());
46         $command->setHelperSet($this->getHelperSet());
47         $command->setGenerator($this->getGenerator());
48
49         $commandTester = new CommandTester($command);
50
51         $code = $commandTester->execute(
52             [
53             '--theme'           => $theme,
54             '--machine-name'    => $machine_name,
55             '--theme-path'      => $theme_path,
56             '--description'     => $description,
57             '--core'            => $core,
58             '--package'         => $package,
59             '--global-library'  => $global_library,
60             '--base-theme'      => $base_theme,
61             '--regions'         => $regions,
62             '--breakpoints'     => $breakpoints
63             ],
64             ['interactive' => false]
65         );
66
67         $this->assertEquals(0, $code);
68     }
69
70     private function getGenerator()
71     {
72         return $this
73             ->getMockBuilder('Drupal\Console\Generator\ThemeGenerator')
74             ->disableOriginalConstructor()
75             ->setMethods(['generate'])
76             ->getMock();
77     }
78 }