From 6d0a9b672e8d1d8ef822d0ff19212c530b0abe11 Mon Sep 17 00:00:00 2001 From: David Maicher Date: Fri, 26 Apr 2024 13:15:32 +0200 Subject: [PATCH] fix failing dev tests on CI --- .github/workflows/ci.yml | 4 +--- composer.json | 2 +- tests/Functional/PhpunitTest.php | 18 ++++++++++++++++++ tests/Functional/app/config.yml | 4 ++++ 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 474fed6..61fccfa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: SYMFONY_REQUIRE: "${{ matrix.symfony_require }}" services: mysql: - image: mysql:5.7 + image: mysql:8.0 env: MYSQL_ALLOW_EMPTY_PASSWORD: true ports: @@ -20,8 +20,6 @@ jobs: fail-fast: false matrix: include: - - php: 7.3 - test_make_target: test_phpunit_legacy - php: 7.4 composer_flags: --prefer-lowest test_make_target: test_phpunit_legacy diff --git a/composer.json b/composer.json index e3e6c0b..cbdd0f6 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ } ], "require": { - "php": "^7.3 || ^8.0", + "php": "^7.4 || ^8.0", "ext-json": "*", "doctrine/dbal": "^3.3 || ^4.0", "doctrine/doctrine-bundle": "^2.2.2", diff --git a/tests/Functional/PhpunitTest.php b/tests/Functional/PhpunitTest.php index 22bc84f..ebdd0bd 100644 --- a/tests/Functional/PhpunitTest.php +++ b/tests/Functional/PhpunitTest.php @@ -52,6 +52,24 @@ public static function someDataProvider(): iterable yield [0]; } + public function testChangeDbStateForConnectionWithoutServerVersion(): void + { + $this->connection = $this->kernel->getContainer()->get('doctrine.dbal.no_server_version_connection'); + $this->assertRowCount(0); + $this->insertRow(); + $this->assertRowCount(1); + } + + /** + * @depends testChangeDbStateForConnectionWithoutServerVersion + */ + public function testChangeDbStateForConnectionWithoutServerVersionRolledBack(): void + { + $this->connection = $this->kernel->getContainer()->get('doctrine.dbal.no_server_version_connection'); + $this->assertRowCount(0); + $this->assertFalse($this->connection->isTransactionActive()); + } + public function testChangeDbStateForReplicaConnection(): void { $this->connection = $this->kernel->getContainer()->get('doctrine.dbal.replica_connection'); diff --git a/tests/Functional/app/config.yml b/tests/Functional/app/config.yml index 1bc4eac..98acb71 100644 --- a/tests/Functional/app/config.yml +++ b/tests/Functional/app/config.yml @@ -11,6 +11,10 @@ doctrine: url: '%database.url%' server_version: 8.0.31 use_savepoints: true + + no_server_version: + url: '%database.url%' + use_savepoints: true replica: url: '%database.url%'