From b8c647f65aa347f4ef8d4b90b993f116901950fa Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 8 Nov 2020 16:47:41 +0000 Subject: [PATCH 1/3] Male the tests work again with PHP 7.2 --- tests/functional/DependencyCheckTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/functional/DependencyCheckTest.php b/tests/functional/DependencyCheckTest.php index da7103e43..42dcb7817 100644 --- a/tests/functional/DependencyCheckTest.php +++ b/tests/functional/DependencyCheckTest.php @@ -79,6 +79,7 @@ class DependencyCheckTest extends TestCase self::assertInstanceOf(ConfigFileLoader::class, $configFileLoader); $configCache = new Cache(); + $configCache->set('database', 'disable_pdo', true); $configFileLoader->setupCache($configCache); self::assertNotEmpty($configCache->getAll()); @@ -123,8 +124,8 @@ class DependencyCheckTest extends TestCase self::assertNotNull($database->getConnection(), 'There is no database connection'); $result = $database->p("SELECT 1"); - self::assertEquals($database->errorMessage(), '', 'There had been a database error message'); - self::assertEquals($database->errorNo(), 0, 'There had been a database error number'); + self::assertEquals('', $database->errorMessage(), 'There had been a database error message'); + self::assertEquals(0, $database->errorNo(), 'There had been a database error number'); self::assertTrue($database->connected(), 'The database is not connected'); } From b0cf539048e86e82d3f6b43d23c75870ac423686 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 8 Nov 2020 17:13:12 +0000 Subject: [PATCH 2/3] Another test to disable PDO for tests --- tests/functional/DependencyCheckTest.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/functional/DependencyCheckTest.php b/tests/functional/DependencyCheckTest.php index 42dcb7817..62816f4c7 100644 --- a/tests/functional/DependencyCheckTest.php +++ b/tests/functional/DependencyCheckTest.php @@ -79,7 +79,6 @@ class DependencyCheckTest extends TestCase self::assertInstanceOf(ConfigFileLoader::class, $configFileLoader); $configCache = new Cache(); - $configCache->set('database', 'disable_pdo', true); $configFileLoader->setupCache($configCache); self::assertNotEmpty($configCache->getAll()); @@ -116,11 +115,16 @@ class DependencyCheckTest extends TestCase public function testDatabase() { + $configCache = $this->dice->create(Cache::class); + $configCache->set('database', 'disable_pdo', true); + /** @var Database $database */ $database = $this->dice->create(Database::class); + $database->setTestmode(true); + self::assertInstanceOf(Database::class, $database); - self::assertContains($database->getDriver(), [Database::PDO, Database::MYSQLI], 'The driver returns an unexpected value'); + self::assertContains($database->getDriver(), [Database::MYSQLI], 'The driver returns an unexpected value'); self::assertNotNull($database->getConnection(), 'There is no database connection'); $result = $database->p("SELECT 1"); From f23ec66801f37169b8ef9d5100409f8795047a67 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 8 Nov 2020 17:26:20 +0000 Subject: [PATCH 3/3] Disable PDO for the AppMode test as well --- tests/functional/DependencyCheckTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/functional/DependencyCheckTest.php b/tests/functional/DependencyCheckTest.php index 62816f4c7..fcd3ca521 100644 --- a/tests/functional/DependencyCheckTest.php +++ b/tests/functional/DependencyCheckTest.php @@ -136,6 +136,9 @@ class DependencyCheckTest extends TestCase public function testAppMode() { + $configCache = $this->dice->create(Cache::class); + $configCache->set('database', 'disable_pdo', true); + /** @var App\Mode $mode */ $mode = $this->dice->create(App\Mode::class);