diff --git a/src/Dev/SapphireTest.php b/src/Dev/SapphireTest.php index 35487b620..85603083f 100644 --- a/src/Dev/SapphireTest.php +++ b/src/Dev/SapphireTest.php @@ -1130,6 +1130,11 @@ class SapphireTest extends PHPUnit_Framework_TestCase // Reinstate PHPUnit error handling set_error_handler(array('PHPUnit_Util_ErrorHandler', 'handleError')); + // Ensure test db is killed on exit + register_shutdown_function(function () { + static::kill_temp_db(); + }); + return $dbname; }