function ColorTest::setUp

Overrides BrowserTestBase::setUp

File

core/modules/color/tests/src/Functional/ColorTest.php, line 54

Class

ColorTest
Modify the Bartik theme colors and make sure the changes are reflected on the frontend.

Namespace

Drupal\Tests\color\Functional

Code

protected function setUp() {
  parent::setUp();
  // Create user.
  $this->bigUser = $this->drupalCreateUser([
    'administer themes',
  ]);
  // This tests the color module in Bartik.
  $this->themes = [
    'bartik' => [
      'palette_input' => 'palette[bg]',
      'scheme' => 'slate',
      'scheme_color' => '#3b3b3b',
    ],
    'color_test_theme' => [
      'palette_input' => 'palette[bg]',
      'scheme' => 'custom',
      'scheme_color' => '#3b3b3b',
    ],
  ];
  \Drupal::service('theme_installer')->install(array_keys($this->themes));
  // Array filled with valid and not valid color values.
  $this->colorTests = [
    '#000' => TRUE,
    '#123456' => TRUE,
    '#abcdef' => TRUE,
    '#0' => FALSE,
    '#00' => FALSE,
    '#0000' => FALSE,
    '#00000' => FALSE,
    '123456' => FALSE,
    '#00000g' => FALSE,
  ];
}

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