diff options
Diffstat (limited to 'modules/simpletest/tests/theme.test')
-rw-r--r-- | modules/simpletest/tests/theme.test | 23 |
1 files changed, 23 insertions, 0 deletions
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); + } } /** |