diff --git a/app/tests/bootstrap.php b/app/tests/bootstrap.php index 050abc3df..329e53a2c 100644 --- a/app/tests/bootstrap.php +++ b/app/tests/bootstrap.php @@ -89,9 +89,10 @@ $setEnv('COMANAGE_REGISTRY_DATABASE_PERSISTENT', 'false'); ConnectionManager::drop('test'); +ConnectionManager::drop('default'); if ($dbEngine === 'postgres') { - ConnectionManager::setConfig('test', [ + $config = [ 'className' => Connection::class, 'driver' => Postgres::class, 'persistent' => false, @@ -101,10 +102,10 @@ 'password' => $testDbPass, 'database' => $testDbName, 'quoteIdentifiers' => false, - ]); + ]; } else { // mysql or mariadb (CakePHP uses the MySQL driver for MariaDB) - ConnectionManager::setConfig('test', [ + $config = [ 'className' => Connection::class, 'driver' => Mysql::class, 'persistent' => false, @@ -116,8 +117,12 @@ 'encoding' => 'utf8mb4', 'timezone' => 'UTC', 'quoteIdentifiers' => false, - ]); + ]; } + +ConnectionManager::setConfig('test', $config); +ConnectionManager::setConfig('default', $config); + // ----------------------------------------------------- // Connection aliasing needs to happen before migrations are run.