From 1e5ff1efa2c3a6c0a64097a78286a76489d13e18 Mon Sep 17 00:00:00 2001 From: Alejandro Ibarra Date: Fri, 18 Nov 2022 11:43:49 +0100 Subject: [PATCH] Fix unit tests 3.x --- tests/TestCase/ConfigurationTraitTest.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/TestCase/ConfigurationTraitTest.php b/tests/TestCase/ConfigurationTraitTest.php index 423443fd..17e9accf 100644 --- a/tests/TestCase/ConfigurationTraitTest.php +++ b/tests/TestCase/ConfigurationTraitTest.php @@ -306,8 +306,16 @@ protected function _getCommandMock(string $migrationsPath, string $seedsPath): E */ public function testGetConfigNoMigrationsFolderDebugDisabled() { + ConnectionManager::setConfig('default', [ + 'className' => 'Cake\Database\Connection', + 'driver' => 'Cake\Database\Driver\Mysql', + 'host' => 'foo.bar', + 'username' => 'root', + 'password' => 'the_password', + 'database' => 'the_database', + 'encoding' => 'utf-8', + ]); Configure::write('debug', false); - $migrationsPath = ROOT . DS . 'config' . DS . 'TestGetConfigMigrations'; $seedsPath = ROOT . DS . 'config' . DS . 'TestGetConfigSeeds'; @@ -353,6 +361,15 @@ public function testGetConfigNoSeedsFolderDebugDisabled() */ public function testGetConfigNoMigrationsOrSeedsFolderDebugEnabled() { + ConnectionManager::setConfig('default', [ + 'className' => 'Cake\Database\Connection', + 'driver' => 'Cake\Database\Driver\Mysql', + 'host' => 'foo.bar', + 'username' => 'root', + 'password' => 'the_password', + 'database' => 'the_database', + 'encoding' => 'utf-8', + ]); $migrationsPath = ROOT . DS . 'config' . DS . 'TestGetConfigMigrations'; $seedsPath = ROOT . DS . 'config' . DS . 'TestGetConfigSeeds'; mkdir($migrationsPath, 0777, true);