diff options
Diffstat (limited to 'modules/system')
-rw-r--r-- | modules/system/system.api.php | 2 | ||||
-rw-r--r-- | modules/system/system.test | 28 |
2 files changed, 29 insertions, 1 deletions
diff --git a/modules/system/system.api.php b/modules/system/system.api.php index 5162b69c7..153ddca83 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -877,7 +877,7 @@ function hook_forms($form_id, $args) { function hook_boot() { // we need user_access() in the shutdown function. make sure it gets loaded drupal_load('module', 'user'); - register_shutdown_function('devel_shutdown'); + drupal_register_shutdown_function('devel_shutdown'); } /** diff --git a/modules/system/system.test b/modules/system/system.test index e33ad11a8..79e141225 100644 --- a/modules/system/system.test +++ b/modules/system/system.test @@ -1598,3 +1598,31 @@ class FloodFunctionalTest extends DrupalWebTestCase { $this->assertFalse(flood_is_allowed($name, $threshold)); } } + +/** + * Functional tests shutdown functions. + */ +class ShutdownFunctionsTest extends DrupalWebTestCase { + public static function getInfo() { + return array( + 'name' => 'Shutdown functions', + 'description' => 'Functional tests for shutdown functions', + 'group' => 'System', + ); + } + + function setUp() { + parent::setUp('system_test'); + } + + /** + * Test flood control mechanism clean-up. + */ + function testShutdownFunctions() { + $arg1 = $this->randomName(); + $arg2 = $this->randomName(); + $this->drupalGet('system-test/shutdown-functions/' . $arg1 . '/' . $arg2); + $this->assertText(t('First shutdown function, arg1 : @arg1, arg2: @arg2', array('@arg1' => $arg1, '@arg2' => $arg2))); + $this->assertText(t('Second shutdown function, arg1 : @arg1, arg2: @arg2', array('@arg1' => $arg1, '@arg2' => $arg2))); + } +}
\ No newline at end of file |