mirror of
https://github.com/silverstripe/silverstripe-testsession
synced 2024-10-22 14:06:00 +02:00
Merge d670ff13ef
into 097313b0f1
This commit is contained in:
commit
051fe891af
@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user