mirror of
https://github.com/silverstripe/silverstripe-testsession
synced 2024-10-22 14:06:00 +02:00
Compare commits
2 Commits
87b4f99f91
...
051fe891af
Author | SHA1 | Date | |
---|---|---|---|
|
051fe891af | ||
|
d670ff13ef |
@ -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