946d1e38c50664877287e80b8f999897206a05f6
[yaffs-website] / web / core / modules / color / tests / src / Kernel / Migrate / d7 / MigrateColorTest.php
1 <?php
2
3 namespace Drupal\Tests\color\Kernel\Migrate\d7;
4
5 use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
6
7 /**
8  * Tests migration of Color variables to configuration.
9  *
10  * @group color
11  */
12 class MigrateColorTest extends MigrateDrupal7TestBase {
13
14   /**
15    * {@inheritdoc}
16    */
17   public static $modules = ['color'];
18
19   /**
20    * {@inheritdoc}
21    */
22   protected function setUp() {
23     parent::setUp();
24     // Install the themes used for this test.
25     $this->container->get('theme_installer')->install(['bartik']);
26     $this->executeMigration('d7_color');
27   }
28
29   /**
30    * Tests migration of color's variables to configuration.
31    */
32   public function testMigrateColor() {
33     // Test Bartik migration.
34     $config = $this->config('color.theme.bartik');
35     $files = [
36       'public://color/bartik-e0e23ad7/logo.png',
37       'public://color/bartik-e0e23ad7/colors.css',
38     ];
39     $this->assertSame($files, $config->get('files'));
40     $this->assertSame('public://color/bartik-e0e23ad7/logo.png', $config->get('logo'));
41     $palette = [
42       'top' => '#d0d0d0',
43       'bottom' => '#c2c4c5',
44       'bg' => '#ffffff',
45       'sidebar' => '#ffffff',
46       'sidebarborders' => '#cccccc',
47       'footer' => '#24272c',
48       'titleslogan' => '#000000',
49       'text' => '#4a4a4a',
50       'link' => '#019dbf',
51     ];
52     $this->assertSame($palette, $config->get('palette'));
53     $this->assertSame(['public://color/bartik-e0e23ad7/colors.css'], $config->get('stylesheets'));
54     // Test that the screenshot was not migrated.
55     $this->assertNull($config->get('screenshot'));
56
57     // Test that garland was not migrated.
58     $this->assertEmpty(\Drupal::config('color.theme.garland')->get());
59   }
60
61 }