summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests/theme.test
diff options
context:
space:
mode:
Diffstat (limited to 'modules/simpletest/tests/theme.test')
-rw-r--r--modules/simpletest/tests/theme.test35
1 files changed, 35 insertions, 0 deletions
diff --git a/modules/simpletest/tests/theme.test b/modules/simpletest/tests/theme.test
index d4dc89842..f6dea3309 100644
--- a/modules/simpletest/tests/theme.test
+++ b/modules/simpletest/tests/theme.test
@@ -66,6 +66,14 @@ class ThemeUnitTest extends DrupalWebTestCase {
$_GET['q'] = $q;
$this->assertTrue(in_array('page__front', $suggestions), t('Front page template was suggested.'));
}
+
+ /**
+ * Ensures theme hook_*_alter() implementations can run before anything is rendered.
+ */
+ function testAlter() {
+ $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.'));
+ }
}
/**
@@ -181,3 +189,30 @@ class ThemeHookInitUnitTest extends DrupalWebTestCase {
$this->assertRaw('bartik/css/style.css', t("The default theme's CSS appears on the page when the theme system is initialized in hook_init()."));
}
}
+
+/**
+ * Tests autocompletion not loading registry.
+ */
+class ThemeFastTestCase extends DrupalWebTestCase {
+ public static function getInfo() {
+ return array(
+ 'name' => 'Theme fast initialization',
+ 'description' => 'Test that autocompletion does not load the registry.',
+ 'group' => 'Theme'
+ );
+ }
+
+ function setUp() {
+ parent::setUp('theme_test');
+ $this->account = $this->drupalCreateUser(array('access user profiles'));
+ }
+
+ /**
+ * Tests access to user autocompletion and verify the correct results.
+ */
+ function testUserAutocomplete() {
+ $this->drupalLogin($this->account);
+ $this->drupalGet('user/autocomplete/' . $this->account->name);
+ $this->assertText('registry not initialized', t('The registry was not initialized'));
+ }
+}