Skip to content

Commit

Permalink
all tests use the test DB
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis committed Apr 14, 2026
1 parent 191090e commit dcba6e9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions app/tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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.
Expand Down

0 comments on commit dcba6e9

Please sign in to comment.