Skip to content

Commit

Permalink
fix failing dev tests on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaicher committed Apr 26, 2024
1 parent e2ff86d commit 7edcf87
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
18 changes: 18 additions & 0 deletions tests/Functional/PhpunitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
4 changes: 4 additions & 0 deletions tests/Functional/app/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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%'
Expand Down

0 comments on commit 7edcf87

Please sign in to comment.