function CascadingStylesheetsTestCase::testRenderExternal

7.x common.test CascadingStylesheetsTestCase::testRenderExternal()

Tests rendering an external stylesheet.

File

drupal-7.x/modules/simpletest/tests/common.test, line 669
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.');
}