This commit is contained in:
Steve Boyd 2024-09-18 15:38:49 +12:00 committed by GitHub
commit 051fe891af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -578,6 +578,10 @@ class TestSessionEnvironment
$this->oldDatabaseName = $databaseConfig['database'];
$databaseConfig['database'] = $state->database;
DB::connect($databaseConfig);
// This is required for CMS 5.4+
if (method_exists(DB::class, 'hasConfig') && DB::hasConfig('primary')) {
DB::connect($databaseConfig, 'primary');
}
}
}
}