A search yields a couple of questions on catching fatal exceptions, but this one is specific to using SimpleTest. (I know that SimpleTest is out of date, but getting PHP-Unit to work on my configuration is another question).
I am trying to get the tearDown() method to work even when there is a fatal exception, as I create some test rows in the database during setup, and remove them during tear-down. But when SimpleTest comes to a fatal exception, teardown() is never ran.
Is there a way to get tearDown() to run despite a fatal exeception?
There is a "register_shutdown_fuction" hook that can be used:
register_shutdown_function(array($this, 'shutdownHandler'));
In "shutdownHandler" you can write:
error_get_last() && $this->tearDown();