function MigrateColorTest::testMigrateColor

Same name and namespace in other branches
  1. 9 core/modules/color/tests/src/Kernel/Migrate/d7/MigrateColorTest.php \Drupal\Tests\color\Kernel\Migrate\d7\MigrateColorTest::testMigrateColor()

Tests migration of color's variables to configuration.

File

core/modules/color/tests/src/Kernel/Migrate/d7/MigrateColorTest.php, line 32

Class

MigrateColorTest
Tests migration of Color variables to configuration.

Namespace

Drupal\Tests\color\Kernel\Migrate\d7

Code

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());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.