Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
17402d76
Commit
17402d76
authored
15 years ago
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
#472820
follow-up by sun: Fixed tests for CSS output.
parent
4ce72ad5
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/simpletest/tests/common.test
+15
-20
15 additions, 20 deletions
modules/simpletest/tests/common.test
with
15 additions
and
20 deletions
modules/simpletest/tests/common.test
+
15
−
20
View file @
17402d76
...
...
@@ -625,11 +625,10 @@ class DrupalCSSIdentifierTestCase extends DrupalUnitTestCase {
}
}
/**
* CSS Unit Tests.
*/
class
CascadingStylesheetsUnitTest
Case
extends
Drupal
Web
TestCase
{
class
CascadingStylesheetsUnitTest
extends
Drupal
Unit
TestCase
{
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'CSS Unit Tests'
,
...
...
@@ -639,37 +638,33 @@ class CascadingStylesheetsUnitTestCase extends DrupalWebTestCase {
}
/**
* Tests basic CSS loading with and without optimization
*
(drupal_load_stylesheet()).
* This can be enhanced by adding additional
css
files with variant test cases.
* Tests basic CSS loading with and without optimization
via drupal_load_stylesheet().
*
* This can be enhanced by adding additional
CSS
files with variant test cases.
* Currently, this is specifically testing to make sure that whitespace
* is treated with adequate respect (not arbitrarily removing linefeeds).
*/
function
testLoadCssBasic
()
{
/
**
* Array of files to test.
Original
=
.css
,
* u
noptimized expected
output =
.css.unoptimized.css
,
* o
ptimized expected
=
.css.optimized.css
* They live in the simpletest/files/css_test_files directory
*/
$testfiles
=
array
(
'css_input_without_import.css'
,
);
/
/ Array of files to test living in 'simpletest/files/css_test_files/'.
// -
Original
: name
.css
// - U
noptimized expected
content: name
.css.unoptimized.css
// - O
ptimized expected
content: name
.css.optimized.css
$testfiles
=
array
(
'css_input_without_import.css'
,
);
$path
=
drupal_get_path
(
'module'
,
'simpletest'
)
.
'/files/css_test_files'
;
foreach
(
$testfiles
as
$file
)
{
$expected
=
file_get_contents
(
"
$path
/
$file
.unoptimized.css"
);
$unoptimized_output
=
drupal_load_stylesheet
(
"
$path
/
$file
"
,
FALSE
);
$this
->
assertEqual
(
$unoptimized_output
,
$expected
,
t
(
'Loaded CSS Stylesheet has expected contents (unoptimized) (@file)'
,
array
(
'@file'
=>
$file
)));
$unoptimized_output
=
drupal_load_stylesheet
(
"
$path
/
$file
.unoptimized.css"
,
FALSE
);
$this
->
assertEqual
(
$unoptimized_output
,
$expected
,
t
(
'Unoptimized CSS file has expected contents (@file)'
,
array
(
'@file'
=>
$file
)));
$expected
=
file_get_contents
(
"
$path
/
$file
.optimized.css"
);
$optimized_output
=
drupal_load_stylesheet
(
"
$path
/
$file
"
,
TRUE
);
$this
->
assertEqual
(
$optimized_output
,
$expected
,
t
(
'Loaded CSS Stylesheet has expected contents (optimized) (@file)'
,
array
(
'@file'
=>
$file
)));
$this
->
assertEqual
(
$optimized_output
,
$expected
,
t
(
'Optimized CSS file has expected contents (@file)'
,
array
(
'@file'
=>
$file
)));
}
}
}
/**
* Test drupal_http_request().
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment