Commit 270afb9d authored by jhodgdon's avatar jhodgdon

Issue #1816760 by SV, DeimoS, aellison, Mark Carver, yanniboi: Fix up docs in ColorTest

parent 441b3f30
......@@ -2,7 +2,7 @@
/**
* @file
* Definition of Drupal\color\Tests\ColorTest.
* Contains \Drupal\color\Tests\ColorTest.
*/
namespace Drupal\color\Tests;
......@@ -21,8 +21,28 @@ class ColorTest extends WebTestBase {
*/
public static $modules = array('color', 'color_test');
/**
* A user with administrative permissions.
*
* @var \Drupal\user\UserInterface
*/
protected $big_user;
/**
* An associative array of settings for themes.
*
* @var array
*/
protected $themes;
/**
* Associative array of hex color strings to test.
*
* Keys are the color string and values are a Boolean set to TRUE for valid
* colors.
*
* @var array
*/
protected $colorTests;
public static function getInfo() {
......@@ -33,10 +53,13 @@ public static function getInfo() {
);
}
/**
* {@inheritdoc}
*/
function setUp() {
parent::setUp();
// Create users.
// Create user.
$this->big_user = $this->drupalCreateUser(array('administer themes'));
// This tests the color module in Bartik.
......@@ -54,7 +77,7 @@ function setUp() {
);
theme_enable(array_keys($this->themes));
// Array filled with valid and not valid color values
// Array filled with valid and not valid color values.
$this->colorTests = array(
'#000' => TRUE,
'#123456' => TRUE,
......@@ -79,6 +102,12 @@ function testColor() {
/**
* Tests the Color module functionality using the given theme.
*
* @param string $theme
* The machine name of the theme being tested.
* @param array $test_values
* An associative array of test settings (i.e. 'Main background', 'Text
* color', 'Color set', etc) for the theme which being tested.
*/
function _testColor($theme, $test_values) {
\Drupal::config('system.theme')
......@@ -101,7 +130,6 @@ function _testColor($theme, $test_values) {
$this->assertTrue(strpos($stylesheet_content, 'color: #123456') !== FALSE, 'Make sure the color we changed is in the color stylesheet. (' . $theme . ')');
}
$this->drupalGet($settings_path);
$this->assertResponse(200);
$edit['scheme'] = $test_values['scheme'];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment