sebastianbergmann/phpunit — pull request #672 by Domini (2012-09-27 15:49:08+00:00)
Title: Deferred error handling

When you write a functional test on a method that acquires a resource, does something that leads to a trigger_error(), and then releases the resource, PHPUnit_Util_ErrorHandler will convert the error to exception and throw it right where it happened, so the resource won't be released. If you want to assert whether error was triggered, you use setExpectedException(). But in this case the resource won't be released and test won't isolated enough.

I've implemented setExpectedExceptionDeferred() to continue execution in case of trigger_error().