summaryrefslogtreecommitdiff
path: root/modules/color/color.test
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-11-13 14:06:43 +0000
committerDries Buytaert <dries@buytaert.net>2010-11-13 14:06:43 +0000
commit346854c12e5ce1560df35de492a4c283623dccfb (patch)
tree2766a148aefaf1cd4a2e92d2156c547f49d7fa68 /modules/color/color.test
parentb51569528f42fbecbcefc4ffb2d9b982d43e0186 (diff)
downloadbrdo-346854c12e5ce1560df35de492a4c283623dccfb.tar.gz
brdo-346854c12e5ce1560df35de492a4c283623dccfb.tar.bz2
- Patch #927406 by Damien Tournoud, carlos8f, george@dynapres.nl, amateescu, Volx: colorable themes fail when CSS aggregation is enabled due to improper stream wrapper usage.
Diffstat (limited to 'modules/color/color.test')
-rw-r--r--modules/color/color.test17
1 files changed, 13 insertions, 4 deletions
diff --git a/modules/color/color.test b/modules/color/color.test
index 6fb00c26e..f59d8d7ff 100644
--- a/modules/color/color.test
+++ b/modules/color/color.test
@@ -71,8 +71,7 @@ class ColorTestCase extends DrupalWebTestCase {
$this->assertPattern('|' . file_create_url($stylesheets[0]) . '|', 'Make sure the color stylesheet is included in the content. (' . $theme . ')');
$stylesheet_content = join("\n", file($stylesheets[0]));
- $matched = preg_match('/(.*color: #123456.*)/i', $stylesheet_content, $matches);
- $this->assertTrue($matched == 1, 'Make sure the color we changed is in the color stylesheet. (' . $theme . ')');
+ $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);
@@ -82,7 +81,17 @@ class ColorTestCase extends DrupalWebTestCase {
$this->drupalGet('<front>');
$stylesheets = variable_get('color_' . $theme . '_stylesheets', array());
$stylesheet_content = join("\n", file($stylesheets[0]));
- $matched = preg_match('/(.*color: ' . $test_values['scheme_color'] . '.*)/i', $stylesheet_content, $matches);
- $this->assertTrue($matched == 1, 'Make sure the color we changed is in the color stylesheet. (' . $theme . ')');
+ $this->assertTrue(strpos($stylesheet_content, 'color: ' . $test_values['scheme_color']) !== FALSE, 'Make sure the color we changed is in the color stylesheet. (' . $theme . ')');
+
+ // Test with aggregated CSS turned on.
+ variable_set('preprocess_css', 1);
+ $this->drupalGet('<front>');
+ $stylesheets = variable_get('drupal_css_cache_files', array());
+ $stylesheet_content = '';
+ foreach ($stylesheets as $key => $uri) {
+ $stylesheet_content .= join("\n", file(drupal_realpath($uri)));
+ }
+ $this->assertTrue(strpos($stylesheet_content, 'public://') === FALSE, 'Make sure the color paths have been translated to local paths. (' . $theme . ')');
+ variable_set('preprocess_css', 0);
}
}