tags:

views:

212

answers:

3

It doesn't appear to do it by default, and I don't see any switch for it either.

This is PHPUnit 2.3.5, and PHP 5.2.0-8.

A: 

Your available option appears to be using set_error_handler() to override the error process (PHPUnit installs its own, which you'd be replacing). Then you'd either duplicate what PHPUnit's error handler does, except triggering failure on E_NOTICEs, or hand off to PHPUnit's error handler (which you'll get a handle to returned from set_error_handler()) and fake up E_NOTICES as something more critical.

chaos
+1  A: 
function exception_error_handler($errno, $errstr, $errfile, $errline ) 
{
    throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
}
set_error_handler("exception_error_handler");
porneL
+2  A: 

You want to upgrade to a more recent version of PHPUnit, have a look at http://www.phpunit.de/.

Hey man! I'm actually implementing PHPUnit after you presented it to us at the Sydney PHP Conference recently. It's Great!
Dean