diff --git a/.travis.yml b/.travis.yml index e01e986..6c0c9ed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,10 @@ -dist: xenial +dist: bionic os: linux -arch: amd64 +arch: + - amd64 + - arm64 + - ppc64le language: php @@ -10,8 +13,10 @@ services: - postgresql php: - - 7.4 - nightly + - '7.4' +# - '8.0' + before_script: - psql -c 'DROP DATABASE IF EXISTS test;' -U postgres @@ -31,4 +36,5 @@ after_script: jobs: allow_failures: + - arch: ppc64le - php: nightly 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/ + + + + + + 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": { 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'); } 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)';