function CascadingStylesheetsTest::testRenderInlinePreprocess

Tests rendering inline stylesheets with preprocessing on.

File

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

Class

CascadingStylesheetsTest
Tests the Drupal CSS system.

Namespace

Drupal\system\Tests\Common

Code

function testRenderInlinePreprocess() {
  $css = 'body { padding: 0px; }';
  $css_preprocessed = '<style media="all">' . "\n/* <![CDATA[ */\n" . drupal_load_stylesheet_content($css, TRUE) . "\n/* ]]> */\n" . '</style>';
  drupal_add_css($css, array(
    'type' => 'inline',
  ));
  $styles = drupal_get_css();
  $this
    ->assertEqual(trim($styles), $css_preprocessed, 'Rendering preprocessed inline CSS adds it to the page.');
}