function CascadingStylesheetsTest::testRenderExternal

Tests rendering an external stylesheet.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Common/CascadingStylesheetsTest.php, line 109
Definition of Drupal\system\Tests\Common\CascadingStylesheetsTest.

Class

CascadingStylesheetsTest
Tests the Drupal CSS system.

Namespace

Drupal\system\Tests\Common

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