nicer error_handler-handling with php's restore_error_handler()

This commit is contained in:
messju
2004-09-14 07:22:51 +00:00
parent 427abe0c6d
commit 08ecea66f4

View File

@@ -407,12 +407,11 @@ foo:foo:b', $this->smarty->fetch('assign_obj.tpl'));
function test_core_is_secure_function_smarty_var_const_not_allowed() { function test_core_is_secure_function_smarty_var_const_not_allowed() {
$security = $this->smarty->security; $security = $this->smarty->security;
$this->smarty->security = true; $this->smarty->security = true;
/* save old error_handler */ /* catch errors: */
$this->errorlevel = null; $this->errorlevel = null;
$error_handler = set_error_handler(array(&$this, 'error_handler')); set_error_handler(array(&$this, 'error_handler'));
$this->smarty->fetch('constant.tpl', null, 'var_const_not_allowed'); $this->smarty->fetch('constant.tpl', null, 'var_const_not_allowed');
/* restore old error_handler */ restore_error_handler();
if ($error_handler) set_error_handler($error_handler);
$this->assertEquals( $this->errorlevel, E_USER_WARNING); $this->assertEquals( $this->errorlevel, E_USER_WARNING);
$this->smarty->security = $security; $this->smarty->security = $security;