Compare commits

...

2 Commits

Author SHA1 Message Date
Steve Boyd
051fe891af
Merge d670ff13ef into 097313b0f1 2024-09-18 15:38:49 +12:00
Steve Boyd
d670ff13ef FIX Ensure primary connection is updated with temporary database 2024-09-18 15:38:44 +12:00

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');
}
}
}
}