From 5af43f636348ac1ab9215ac8373952fdf82f784c Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Thu, 3 Dec 2020 14:32:30 -0500 Subject: [PATCH 1/8] Fix method signature for PHP 8 --- .travis.yml | 2 +- src/ConnectionManager.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index e01e986..32a114d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ services: php: - 7.4 - - nightly + - 8 before_script: - psql -c 'DROP DATABASE IF EXISTS test;' -U postgres diff --git a/src/ConnectionManager.php b/src/ConnectionManager.php index e1a0fa6..d049235 100644 --- a/src/ConnectionManager.php +++ b/src/ConnectionManager.php @@ -59,9 +59,8 @@ final class ConnectionManager { * Prevent serialization of this object * * @throws DomainException - * @return void */ - public function __sleep(): void + public function __sleep() { throw new DomainException('No serializing of singleton'); } From 9c3dc58bef9491795187fa307b51e09f9638c110 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Thu, 3 Dec 2020 14:51:19 -0500 Subject: [PATCH 2/8] Attempt to fix travis build --- .travis.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 32a114d..c69240f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -dist: xenial +dist: focal os: linux arch: amd64 @@ -10,8 +10,10 @@ services: - postgresql php: - - 7.4 - - 8 + - nightly + - '7.4' +# - '8.0' + before_script: - psql -c 'DROP DATABASE IF EXISTS test;' -U postgres From 2aadc3a8db03ba4aba0775ce30158ddc026be9b7 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Thu, 3 Dec 2020 14:56:57 -0500 Subject: [PATCH 3/8] Attempt to fix travis build --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c69240f..797f1be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -dist: focal +dist: bionic os: linux arch: amd64 From 0766efcd2e42308b7fbf85faaacef4c9a1db988d Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Thu, 3 Dec 2020 15:01:21 -0500 Subject: [PATCH 4/8] Try testing on multiple cpu architectures --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 797f1be..ef2bd3b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,10 @@ dist: bionic os: linux -arch: amd64 +arch: + - amd64 + - arm64 + - ppc64le language: php From 8678913cd0b6020798354d91c7e585c07483d523 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Thu, 3 Dec 2020 15:49:58 -0500 Subject: [PATCH 5/8] Update dependencies --- composer.json | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index bfc1f19..d857ff5 100644 --- a/composer.json +++ b/composer.json @@ -34,14 +34,13 @@ "require-dev": { "consolidation/robo": "^2.0.0", "monolog/monolog": "^2.0.1", - "phploc/phploc": "^5.0", + "phploc/phploc": "^7.0", "phpmd/phpmd": "^2.8", "phpstan/phpstan": "^0.12.2", - "phpunit/phpunit": "^8.5", - "sebastian/phpcpd": "^4.1", + "phpunit/phpunit": "^9.4", + "sebastian/phpcpd": "^6.0", "simpletest/simpletest": "^1.1", - "squizlabs/php_codesniffer": "^3.0.0", - "theseer/phpdox": "^0.12.0" + "squizlabs/php_codesniffer": "^3.0.0" }, "autoload": { "psr-4": { From d69655be023dfe848af3fe8b94a0bc71d22ca7d1 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Thu, 3 Dec 2020 15:50:32 -0500 Subject: [PATCH 6/8] Attempt to fix MySQL transaction test --- tests/ConnectionManagerTest.php | 3 --- tests/Drivers/MySQL/MySQLDriverTest.php | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/ConnectionManagerTest.php b/tests/ConnectionManagerTest.php index 35b450a..04f1b08 100644 --- a/tests/ConnectionManagerTest.php +++ b/tests/ConnectionManagerTest.php @@ -91,8 +91,6 @@ class ConnectionManagerTest extends TestCase { }; $conn = self::$instance->connect($params); - $this->assertInstanceOf(QueryBuilderInterface::class, $conn); - // Check that the connection just made is returned from the get_connection method $this->assertEqual($conn, self::$instance->getConnection()); @@ -111,7 +109,6 @@ class ConnectionManagerTest extends TestCase { ]; $conn = self::$instance->connect($params); - $this->assertInstanceOf(QueryBuilderInterface::class, $conn); $this->assertEqual($conn, self::$instance->getConnection('conn_manager')); } diff --git a/tests/Drivers/MySQL/MySQLDriverTest.php b/tests/Drivers/MySQL/MySQLDriverTest.php index 14edd87..4c8ed90 100644 --- a/tests/Drivers/MySQL/MySQLDriverTest.php +++ b/tests/Drivers/MySQL/MySQLDriverTest.php @@ -154,6 +154,13 @@ SQL; public function testCommitTransaction(): void { + // Make sure we aren't already in a transaction + if (self::$db->inTransaction()) + { + self::$db->commit(); + } + + $this->assertFalse(self::$db->inTransaction()); $this->assertTrue(self::$db->beginTransaction()); $sql = 'INSERT INTO `create_test` (`id`, `key`, `val`) VALUES (10, 12, 14)'; @@ -165,6 +172,13 @@ SQL; public function testRollbackTransaction(): void { + // Make sure we aren't already in a transaction + if (self::$db->inTransaction()) + { + self::$db->commit(); + } + + $this->assertFalse(self::$db->inTransaction()); $this->assertTrue(self::$db->beginTransaction()); $sql = 'INSERT INTO `create_test` (`id`, `key`, `val`) VALUES (182, 96, 43)'; From a174a6747f0b5379dc11042d309a37c06d662a3b Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Thu, 3 Dec 2020 15:53:03 -0500 Subject: [PATCH 7/8] Update phpunit config --- build/phpunit.xml | 66 ++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 35 deletions(-) diff --git a/build/phpunit.xml b/build/phpunit.xml index 97f3bb2..dec3ac4 100644 --- a/build/phpunit.xml +++ b/build/phpunit.xml @@ -1,36 +1,32 @@ - - - - ./../src/ - - - - - ./../tests/CoreTest.php - ./../tests/ConnectionManagerTest.php - ./../tests/QueryParserTest.php - - - ./../tests/Drivers/MySQL/ - - - ./../tests/Drivers/PgSQL/ - - - ./../tests/Drivers/SQLite/ - - - - - - - - - \ No newline at end of file + + + + ./../src/ + + + + + + + + + + ./../tests/CoreTest.php + ./../tests/ConnectionManagerTest.php + ./../tests/QueryParserTest.php + + + ./../tests/Drivers/MySQL/ + + + ./../tests/Drivers/PgSQL/ + + + ./../tests/Drivers/SQLite/ + + + + + + From 4c8cd18060cbeadeb513ebe88513a8d41b70c496 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Thu, 3 Dec 2020 16:22:09 -0500 Subject: [PATCH 8/8] Fix travis config by allowing ppc to fail --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index ef2bd3b..6c0c9ed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,4 +36,5 @@ after_script: jobs: allow_failures: + - arch: ppc64le - php: nightly