You are here

function CascadingStylesheetsTestCase::testAlter in Drupal 7

Tests Locale module's CSS Alter to include RTL overrides.

File

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

Class

CascadingStylesheetsTestCase
Test the Drupal CSS system.

Code

function testAlter() {

  // Switch the language to a right to left language and add system.base.css.
  global $language;
  $language->direction = LANGUAGE_RTL;
  $path = drupal_get_path('module', 'system');
  drupal_add_css($path . '/system.base.css');

  // Check to see if system.base-rtl.css was also added.
  $styles = drupal_get_css();
  $this
    ->assert(strpos($styles, $path . '/system.base-rtl.css') !== FALSE, 'CSS is alterable as right to left overrides are added.');

  // Change the language back to left to right.
  $language->direction = LANGUAGE_LTR;
}