summaryrefslogtreecommitdiff
path: root/modules/system/system.test
diff options
context:
space:
mode:
Diffstat (limited to 'modules/system/system.test')
-rw-r--r--modules/system/system.test17
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/system/system.test b/modules/system/system.test
index f273bc7d2..d482afa22 100644
--- a/modules/system/system.test
+++ b/modules/system/system.test
@@ -695,6 +695,10 @@ class CronRunTestCase extends DrupalWebTestCase {
);
}
+ function setUp() {
+ parent::setUp(array('common_test', 'common_test_cron_helper'));
+ }
+
/**
* Test cron runs.
*/
@@ -799,6 +803,19 @@ class CronRunTestCase extends DrupalWebTestCase {
$this->assertTrue(file_exists($perm_old->uri), t('Old permanent file was correctly ignored.'));
$this->assertTrue(file_exists($perm_new->uri), t('New permanent file was correctly ignored.'));
}
+
+ /**
+ * Make sure exceptions thrown on hook_cron() don't affect other modules.
+ */
+ function testCronExceptions() {
+ variable_del('common_test_cron');
+ // The common_test module throws an exception. If it isn't caught, the tests
+ // won't finish successfully.
+ // The common_test_cron_helper module sets the 'common_test_cron' variable.
+ $this->cronRun();
+ $result = variable_get('common_test_cron');
+ $this->assertEqual($result, 'success', t('Cron correctly handles exceptions thrown during hook_cron() invocations.'));
+ }
}
class AdminMetaTagTestCase extends DrupalWebTestCase {