summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-10-05 14:56:43 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-10-05 14:56:43 +0000
commit17402d76a9b174405df920ff5744fe3e952dc631 (patch)
tree012fa884a8f5df7ae5d70949a412b926fafbaa35
parent4ce72ad5a4524a354c5bda90a13651676d14dd6b (diff)
downloadbrdo-17402d76a9b174405df920ff5744fe3e952dc631.tar.gz
brdo-17402d76a9b174405df920ff5744fe3e952dc631.tar.bz2
#472820 follow-up by sun: Fixed tests for CSS output.
-rw-r--r--modules/simpletest/tests/common.test35
1 files changed, 15 insertions, 20 deletions
diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test
index 291750982..25d51d4d7 100644
--- a/modules/simpletest/tests/common.test
+++ b/modules/simpletest/tests/common.test
@@ -625,11 +625,10 @@ class DrupalCSSIdentifierTestCase extends DrupalUnitTestCase {
}
}
-
/**
* CSS Unit Tests.
*/
-class CascadingStylesheetsUnitTestCase extends DrupalWebTestCase {
+class CascadingStylesheetsUnitTest extends DrupalUnitTestCase {
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,
- * unoptimized expected output = .css.unoptimized.css,
- * optimized 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
+ // - Unoptimized expected content: name.css.unoptimized.css
+ // - Optimized 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().
*/