summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-10-15 12:27:34 +0000
committerDries Buytaert <dries@buytaert.net>2009-10-15 12:27:34 +0000
commit35e21e54e1122f98bede28f89d80f2fb13b3fd97 (patch)
treeb757a831278a4dbc99a3ae5042cc37f95f53aacb /modules/simpletest/tests
parent5acbec27001aa382699cf144d9a953c9b725bc01 (diff)
downloadbrdo-35e21e54e1122f98bede28f89d80f2fb13b3fd97.tar.gz
brdo-35e21e54e1122f98bede28f89d80f2fb13b3fd97.tar.bz2
- Patch #412730 by Crell, jbomb, JohnAlbin: theme system should report when a theme key is not found.
Diffstat (limited to 'modules/simpletest/tests')
-rw-r--r--modules/simpletest/tests/theme.test19
1 files changed, 18 insertions, 1 deletions
diff --git a/modules/simpletest/tests/theme.test b/modules/simpletest/tests/theme.test
index 56860bd13..823a50c67 100644
--- a/modules/simpletest/tests/theme.test
+++ b/modules/simpletest/tests/theme.test
@@ -50,6 +50,23 @@ class TemplateUnitTest extends DrupalWebTestCase {
$suggestions = array("page\0");
$this->assertEqual(drupal_discover_template(array('themes/garland'), $suggestions), 'themes/garland/page.tpl.php', t('Unsafe template suggestion fixed'));
}
+
+ /**
+ * Test that not-found theme hook throw a proper exception.
+ */
+ function testThemeHookNotFound() {
+ try {
+ theme('this_does_not_exist');
+
+ $this->fail(t('Exception not thrown for invalid theme hook.'));
+ }
+ catch (ThemeHookNotFoundException $e) {
+ $this->assertEqual($e->getMessage(), t('Theme hook "this_does_not_exist" not found.'), t('Correct exception thrown with correct error message.'));
+ }
+ catch (Exception $e) {
+ $this->fail(t('Exception of type "@type" thrown instead of ThemeHookNotFoundException.', array('@type' => gettype($e))));
+ }
+ }
}
/**
@@ -63,7 +80,7 @@ class ThemeTableUnitTest extends DrupalWebTestCase {
'group' => 'Theme',
);
}
-
+
/**
* Tableheader.js provides 'sticky' table headers, and is included by default.
*/