Merge pull request #6348 from open-sausages/pulls/4.0/test-cleanup-db

ENHANCEMENT Prevent test DBs persisting after testing
This commit is contained in:
Damian Mooyman 2017-05-08 23:14:53 +12:00 committed by GitHub
commit 8f43bc128b

View File

@ -1130,6 +1130,11 @@ class SapphireTest extends PHPUnit_Framework_TestCase
// Reinstate PHPUnit error handling // Reinstate PHPUnit error handling
set_error_handler(array('PHPUnit_Util_ErrorHandler', 'handleError')); 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; return $dbname;
} }