function CascadingStylesheetsTestCase::testRenderExternal

Tests rendering an external stylesheet.

File

modules/simpletest/tests/common.test, line 834

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.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.