diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-04-29 05:22:06 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-04-29 05:22:06 +0000 |
commit | ea75851ef5814a1b118169c56d5005917521eb6c (patch) | |
tree | a40ccac321364062a29757e551a58d393b752b71 /modules/simpletest/tests/theme.test | |
parent | 10eec627bab98eb1a04c333f6cc9594e81a6b49a (diff) | |
download | brdo-ea75851ef5814a1b118169c56d5005917521eb6c.tar.gz brdo-ea75851ef5814a1b118169c56d5005917521eb6c.tar.bz2 |
#764094 by David_Rothstein: Add tests to check that the theme system works in hook_init() (i.e., as early as possible).
Diffstat (limited to 'modules/simpletest/tests/theme.test')
-rw-r--r-- | modules/simpletest/tests/theme.test | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/modules/simpletest/tests/theme.test b/modules/simpletest/tests/theme.test index cb2a39bb0..1f6373723 100644 --- a/modules/simpletest/tests/theme.test +++ b/modules/simpletest/tests/theme.test @@ -44,7 +44,7 @@ class ThemeUnitTest extends DrupalWebTestCase { $suggestions = theme_get_suggestions($args, 'page'); $this->assertEqual($suggestions, array('page__node', 'page__node__%', 'page__node__1'), t('Removed invalid \\0 from suggestions')); } - + /** * Preprocess functions for the base hook should run even for suggestion implementations. */ @@ -155,3 +155,30 @@ class ThemeItemListUnitTest extends DrupalWebTestCase { $this->assertIdentical($expected, $output, 'Nested list is rendered correctly.'); } } + +/** + * Functional test for initialization of the theme system in hook_init(). + */ +class ThemeHookInitUnitTest extends DrupalWebTestCase { + public static function getInfo() { + return array( + 'name' => 'Theme initialization in hook_init()', + 'description' => 'Tests that the theme system can be correctly initialized in hook_init().', + 'group' => 'Theme', + ); + } + + function setUp() { + parent::setUp('theme_test'); + variable_set('theme_default', 'garland'); + } + + /** + * Test that the theme system can generate output when called by hook_init(). + */ + function testThemeInitializationHookInit() { + $this->drupalGet('theme-test/hook-init'); + $this->assertRaw('Themed output generated in hook_init()', t('Themed output generated in hook_init() correctly appears on the page.')); + $this->assertRaw('garland/style.css', t("The default theme's CSS appears on the page when the theme system is initialized in hook_init().")); + } +} |