diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-02-25 20:57:39 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-02-25 20:57:39 +0000 |
commit | 96b9d512c3e037ded1b076e18fc4b6821e3485a5 (patch) | |
tree | 36876bfc053ae5b6109648dd37a68312eee8e3cd /modules/simpletest/tests | |
parent | 6d7e7bb8a31910de2acf6b9e7dd8bb3eb2886dd2 (diff) | |
download | brdo-96b9d512c3e037ded1b076e18fc4b6821e3485a5.tar.gz brdo-96b9d512c3e037ded1b076e18fc4b6821e3485a5.tar.bz2 |
- Patch #228818 by effulgentsia, JonathanRoberts: IE stylesheets ignored after 31 link/style tags.
Diffstat (limited to 'modules/simpletest/tests')
-rw-r--r-- | modules/simpletest/tests/common.test | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test index 7b64d46c4..9a93d75c8 100644 --- a/modules/simpletest/tests/common.test +++ b/modules/simpletest/tests/common.test @@ -558,7 +558,9 @@ class CascadingStylesheetsTestCase extends DrupalWebTestCase { $css = 'http://example.com/style.css'; drupal_add_css($css, 'external'); $styles = drupal_get_css(); - $this->assertTrue(strpos($styles, 'href="' . $css) > 0, t('Rendering an external CSS file.')); + // Stylesheet URL may be the href of a LINK tag or in an @import statement + // of a STYLE tag. + $this->assertTrue(strpos($styles, 'href="' . $css) > 0 || strpos($styles, '@import url("' . $css . '")') > 0, t('Rendering an external CSS file.')); } /** @@ -566,10 +568,10 @@ class CascadingStylesheetsTestCase extends DrupalWebTestCase { */ function testRenderInlinePreprocess() { $css = 'body { padding: 0px; }'; - $css_preprocessed = '<style type="text/css">' . drupal_load_stylesheet_content($css, TRUE) . '</style>'; + $css_preprocessed = '<style type="text/css" media="all">' . drupal_load_stylesheet_content($css, TRUE) . '</style>'; drupal_add_css($css, 'inline'); $styles = drupal_get_css(); - $this->assertEqual($styles, "\n" . $css_preprocessed . "\n", t('Rendering preprocessed inline CSS adds it to the page.')); + $this->assertEqual(trim($styles), $css_preprocessed, t('Rendering preprocessed inline CSS adds it to the page.')); } /** @@ -631,8 +633,10 @@ class CascadingStylesheetsTestCase extends DrupalWebTestCase { $styles = drupal_get_css(); - if (preg_match_all('/href="' . preg_quote($GLOBALS['base_url'] . '/', '/') . '([^?]+)\?/', $styles, $matches)) { - $result = $matches[1]; + // Stylesheet URL may be the href of a LINK tag or in an @import statement + // of a STYLE tag. + if (preg_match_all('/(href="|url\(")' . preg_quote($GLOBALS['base_url'] . '/', '/') . '([^?]+)\?/', $styles, $matches)) { + $result = $matches[2]; } else { $result = array(); |