mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
commit
8f43bc128b
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user