diff options
Diffstat (limited to 'modules/simpletest')
-rw-r--r-- | modules/simpletest/tests/common_test.css | 3 | ||||
-rw-r--r-- | modules/simpletest/tests/common_test.print.css | 3 | ||||
-rw-r--r-- | modules/simpletest/tests/theme.test | 23 |
3 files changed, 29 insertions, 0 deletions
diff --git a/modules/simpletest/tests/common_test.css b/modules/simpletest/tests/common_test.css new file mode 100644 index 000000000..023eae62d --- /dev/null +++ b/modules/simpletest/tests/common_test.css @@ -0,0 +1,3 @@ +/* $Id$ */ + +/* This file is for testing CSS file inclusion, no contents are necessary. */ diff --git a/modules/simpletest/tests/common_test.print.css b/modules/simpletest/tests/common_test.print.css new file mode 100644 index 000000000..023eae62d --- /dev/null +++ b/modules/simpletest/tests/common_test.print.css @@ -0,0 +1,3 @@ +/* $Id$ */ + +/* This file is for testing CSS file inclusion, no contents are necessary. */ diff --git a/modules/simpletest/tests/theme.test b/modules/simpletest/tests/theme.test index f6dea3309..00eb49b89 100644 --- a/modules/simpletest/tests/theme.test +++ b/modules/simpletest/tests/theme.test @@ -74,6 +74,29 @@ class ThemeUnitTest extends DrupalWebTestCase { $this->drupalGet('theme-test/alter'); $this->assertText('The altered data is test_theme_theme_test_alter_alter was invoked.', t('The theme was able to implement an alter hook during page building before anything was rendered.')); } + + /** + * Ensures a theme's .info file is able to override a module CSS file from being added to the page. + * + * @see test_theme.info + */ + function testCSSOverride() { + // Reuse the same page as in testPreprocessForSuggestions(). We're testing + // what is output to the HTML HEAD based on what is in a theme's .info file, + // so it doesn't matter what page we get, as long as it is themed with the + // test theme. First we test with CSS aggregation disabled. + variable_set('preprocess_css', 0); + $this->drupalGet('theme-test/suggestion'); + $this->assertNoText('system.base.css', t('The theme\'s .info file is able to override a module CSS file from being added to the page.')); + + // Also test with aggregation enabled, simply ensuring no PHP errors are + // triggered during drupal_build_css_cache() when a source file doesn't + // exist. Then allow remaining tests to continue with aggregation disabled + // by default. + variable_set('preprocess_css', 1); + $this->drupalGet('theme-test/suggestion'); + variable_set('preprocess_css', 0); + } } /** |