mirror of
https://github.com/silverstripe/silverstripe-testsession
synced 2024-10-22 14:06:00 +02:00
FIX: Ensure TempDatabase->build() doesn't tear down the database after the testsession start request
This commit is contained in:
parent
f7632a8df4
commit
94af2adcc7
@ -277,6 +277,9 @@ class TestSessionEnvironment
|
|||||||
$databaseConfig = DB::getConfig();
|
$databaseConfig = DB::getConfig();
|
||||||
if (!$dbExists && $dbCreate) {
|
if (!$dbExists && $dbCreate) {
|
||||||
$this->oldDatabaseName = $databaseConfig['database'];
|
$this->oldDatabaseName = $databaseConfig['database'];
|
||||||
|
// Ensure we don't allow TempDatabase to immediately kill the newly created DB when the request finishes
|
||||||
|
Config::modify()->set(TempDatabase::class, 'teardown_on_exit', false);
|
||||||
|
|
||||||
// Create a new one with a randomized name
|
// Create a new one with a randomized name
|
||||||
$tempDB = TempDatabase::create();
|
$tempDB = TempDatabase::create();
|
||||||
$dbName = $tempDB->build();
|
$dbName = $tempDB->build();
|
||||||
|
Loading…
Reference in New Issue
Block a user