You are here

function CascadingStylesheetsTestCase::testRenderInlinePreprocess in Drupal 7

Tests rendering inline stylesheets with preprocessing on.

File

modules/simpletest/tests/common.test, line 796
Tests for common.inc functionality.

Class

CascadingStylesheetsTestCase
Test the Drupal CSS system.

Code

function testRenderInlinePreprocess() {
  $css = 'body { padding: 0px; }';
  $css_preprocessed = '<style type="text/css" 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.');
}