FIX: Ensure TempDatabase->build() doesn't tear down the database after the testsession start request

This commit is contained in:
madmatt 2019-09-11 23:30:10 +12:00
parent f7632a8df4
commit 94af2adcc7
1 changed files with 3 additions and 0 deletions

View File

@ -277,6 +277,9 @@ class TestSessionEnvironment
$databaseConfig = DB::getConfig();
if (!$dbExists && $dbCreate) {
$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
$tempDB = TempDatabase::create();
$dbName = $tempDB->build();