From 7edcf8707f75cebb3a00540d896f8dde4a7f69bb 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 | 2 +- tests/Functional/PhpunitTest.php | 18 ++++++++++++++++++ tests/Functional/app/config.yml | 4 ++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8730343..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: 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%'