Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
222
Merge Requests
222
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
270afb9d
Commit
270afb9d
authored
Mar 31, 2014
by
jhodgdon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#1816760
by SV, DeimoS, aellison, Mark Carver, yanniboi: Fix up docs in ColorTest
parent
441b3f30
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
4 deletions
+32
-4
core/modules/color/lib/Drupal/color/Tests/ColorTest.php
core/modules/color/lib/Drupal/color/Tests/ColorTest.php
+32
-4
No files found.
core/modules/color/lib/Drupal/color/Tests/ColorTest.php
View file @
270afb9d
...
...
@@ -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 user
s
.
// 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'
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment