Sander Temme - 2007-01-23

Logged In: YES
user_id=864439
Originator: NO

I just ran into the same thing. It seems as if no error handler is set by default, so trying to restore the old error handler always fails the first time around. Why not use restore_error_handler(), which seems to work more gracefully with the case of a nonexistent callback? Like so:

Index: phpunit.php

--- phpunit.php (revision 4321)
+++ phpunit.php (working copy)
@@ -238,7 +238,7 @@
$this->$name();

if (phpversion() >= '4') {
- set_error_handler($old_handler); // revert to prior error handler
+ restore_error_handler(); // revert to prior error handler
$PHPUnit_testRunning = null;
}
}