mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENHANCEMENT Prevent test DBs persisting after testing
This commit is contained in:
parent
7c23443fb6
commit
0e92ecea0c
@ -1082,6 +1082,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