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.

3 Answers 3

5
function exception_error_handler($errno, $errstr, $errfile, $errline ) 
{
    throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
}
set_error_handler("exception_error_handler");
Sign up to request clarification or add additional context in comments.

Comments

3

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

1 Comment

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

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.