function CascadingStylesheetsTestCase::testRenderExternal in Drupal 7
Tests rendering an external stylesheet.
File
- modules/
simpletest/ tests/ common.test, line 784 - Tests for common.inc functionality.
Class
- CascadingStylesheetsTestCase
- Test the Drupal CSS system.
Code
function testRenderExternal() {
$css = 'http://example.com/style.css';
drupal_add_css($css, 'external');
$styles = drupal_get_css();
// 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, 'Rendering an external CSS file.');
}