You are here

function CascadingStylesheetsTestCase::testAlter in SimpleTest 7

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

File

tests/common.test, line 630
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.css.
  global $language;
  $language->direction = LANGUAGE_RTL;
  drupal_add_css(drupal_get_path('module', 'system') . '/system.css');

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

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