cvs: smarty /unit_test test_cases.php
"Messju Mohr" <[email protected]>
| Newsgroups | gmane.comp.php.cvs.smarty |
|---|---|
| Message-ID | <cvsmessju1095146574@cvsserver> |
messju Tue Sep 14 03:22:54 2004 EDT
Modified files:
/smarty/unit_test test_cases.php
Log:
nicer error_handler-handling with php's restore_error_handler()
http://cvs.php.net/diff.php/smarty/unit_test/test_cases.php?r1=1.9&r2=1.10&ty=u
Index: smarty/unit_test/test_cases.php
diff -u smarty/unit_test/test_cases.php:1.9 smarty/unit_test/test_cases.php:1.10
--- smarty/unit_test/test_cases.php:1.9 Fri Sep 10 15:15:01 2004
+++ smarty/unit_test/test_cases.php Tue Sep 14 03:22:51 2004
@@ -407,12 +407,11 @@
function test_core_is_secure_function_smarty_var_const_not_allowed() {
$security = $this->smarty->security;
$this->smarty->security = true;
- /* save old error_handler */
+ /* catch errors: */
$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');
- /* restore old error_handler */
- if ($error_handler) set_error_handler($error_handler);
+ restore_error_handler();
$this->assertEquals( $this->errorlevel, E_USER_WARNING);
$this->smarty->security = $security;
--
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php