protected function ColorTest::setUp in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/color/src/Tests/ColorTest.php \Drupal\color\Tests\ColorTest::setUp()
Sets up a Drupal site for running functional and integration tests.
Installs Drupal with the installation profile specified in \Drupal\simpletest\WebTestBase::$profile into the prefixed database.
Afterwards, installs any additional modules specified in the static \Drupal\simpletest\WebTestBase::$modules property of each class in the class hierarchy.
After installation all caches are flushed and several configuration values are reset to the values of the parent site executing the test, since the default values may be incompatible with the environment in which tests are being executed.
Overrides WebTestBase::setUp
File
- core/
modules/ color/ src/ Tests/ ColorTest.php, line 54 - Contains \Drupal\color\Tests\ColorTest.
Class
- ColorTest
- Modify the Bartik theme colors and make sure the changes are reflected on the frontend.
Namespace
Drupal\color\TestsCode
protected function setUp() {
parent::setUp();
// Create user.
$this->bigUser = $this
->drupalCreateUser(array(
'administer themes',
));
// This tests the color module in Bartik.
$this->themes = array(
'bartik' => array(
'palette_input' => 'palette[bg]',
'scheme' => 'slate',
'scheme_color' => '#3b3b3b',
),
'color_test_theme' => array(
'palette_input' => 'palette[bg]',
'scheme' => 'custom',
'scheme_color' => '#3b3b3b',
),
);
\Drupal::service('theme_handler')
->install(array_keys($this->themes));
// Array filled with valid and not valid color values.
$this->colorTests = array(
'#000' => TRUE,
'#123456' => TRUE,
'#abcdef' => TRUE,
'#0' => FALSE,
'#00' => FALSE,
'#0000' => FALSE,
'#00000' => FALSE,
'123456' => FALSE,
'#00000g' => FALSE,
);
}