1 common.test CommonCascadingStylesheetsTestCase::testModuleInfo()

Test that stylesheets in module .info files are loaded.

File

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

Class

CommonCascadingStylesheetsTestCase
Test the Backdrop CSS system.

Code

function testModuleInfo() {
  $this->backdropGet('');

  // Verify common_test.css in a STYLE media="all" tag.
  $elements = $this->xpath('//style[@media=:media and contains(text(), :filename)]', array(
    ':media' => 'all',
    ':filename' => 'tests/common_test.css',
  ));
  $this->assertTrue(count($elements), "Stylesheet with media 'all' in module .info file found.");

  // Verify common_test.print.css in a STYLE media="print" tag.
  $elements = $this->xpath('//style[@media=:media and contains(text(), :filename)]', array(
    ':media' => 'print',
    ':filename' => 'tests/common_test.print.css',
  ));
  $this->assertTrue(count($elements), "Stylesheet with media 'print' in module .info file found.");
}