Yaffs site version 1.1
[yaffs-website] / vendor / drupal / console / Test / Generator / ProfileGeneratorTest.php
1 <?php
2 /**
3  * @file
4  * Contains Drupal\Console\Test\Generator\ProfileGeneratorTest.
5  */
6
7 namespace Drupal\Console\Test\Generator;
8
9 use Drupal\Console\Generator\ProfileGenerator;
10 use Drupal\Console\Test\DataProvider\ProfileDataProviderTrait;
11
12 /**
13  * Class ProfileGeneratorTest
14  * @package Drupal\Console\Test\Generator
15  */
16 class ProfileGeneratorTest extends GeneratorTest
17 {
18     use ProfileDataProviderTrait;
19
20     /**
21      * Profile generator test.
22      *
23      * @param $profile
24      * @param $machine_name
25      * @param $profile_path
26      * @param $description
27      * @param $core
28      * @param $dependencies
29      * @param $distribution
30      *
31      * @dataProvider commandData
32      */
33     public function testGenerateProfile(
34         $profile,
35         $machine_name,
36         $profile_path,
37         $description,
38         $core,
39         $dependencies,
40         $themes,
41         $distribution
42     ) {
43         $generator = new ProfileGenerator();
44         $this->getRenderHelper()->setSkeletonDirs($this->getSkeletonDirs());
45         $this->getRenderHelper()->setTranslator($this->getTranslatorHelper());
46         $generator->setHelperSet($this->getHelperSet());
47
48         $generator->generate(
49             $profile,
50             $machine_name,
51             $profile_path,
52             $description,
53             $core,
54             $dependencies,
55             $themes,
56             $distribution
57         );
58
59         $files = [
60             $machine_name . '.info.yml',
61             $machine_name . '.install',
62             $machine_name . '.profile',
63         ];
64
65         foreach ($files as $file) {
66             $file_path = $profile_path . '/' . $machine_name . '/' . $file;
67             $this->assertTrue(
68                 file_exists($file_path),
69                 sprintf('%s has been generated', $file_path)
70             );
71         }
72     }
73
74 }