1 common.test CommonCascadingStylesheetsTestCase::testRenderFile()

Tests rendering the stylesheets.

File

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

Class

CommonCascadingStylesheetsTestCase
Test the Backdrop CSS system.

Code

function testRenderFile() {
  $css = backdrop_get_path('module', 'simpletest') . '/css/simpletest.css';
  backdrop_add_css($css);
  $styles = backdrop_get_css();
  $this->assertTrue(strpos($styles, $css) > 0, 'Rendered CSS includes the added stylesheet.');
  // Verify that newlines are properly added inside style tags.
  $query_string = state_get('css_js_query_string', '0');
  $css_processed = "<style media=\"all\">\n@import url(\"" . check_plain(file_create_url($css)) . "?" . $query_string . "\");\n</style>";
  $this->assertEqual(trim($styles), $css_processed, t('Rendered CSS includes newlines inside style tags for JavaScript use.'));
}