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