Skip to content

Commit

Permalink
Merge pull request #4396 from greg0ire/fix-php8-mysql-mariadb
Browse files Browse the repository at this point in the history
Fix php8 mysql mariadb
  • Loading branch information
morozov authored Nov 1, 2020
2 parents 1906c5f + 09eafbc commit b8665ec
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/Doctrine/Tests/DBAL/Functional/TransactionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Doctrine\DBAL\Platforms\MySqlPlatform;
use Doctrine\Tests\DbalFunctionalTestCase;
use PDOException;

use function sleep;

Expand Down Expand Up @@ -35,6 +36,12 @@ public function testCommitFalse(): void

sleep(2); // during the sleep mysql will close the connection

$this->assertFalse(@$this->connection->commit()); // we will ignore `MySQL server has gone away` warnings
try {
$this->assertFalse(@$this->connection->commit()); // we will ignore `MySQL server has gone away` warnings
} catch (PDOException $e) {
/* For PDO, we are using ERRMODE EXCEPTION, so this catch should be
* necessary as the equivalent of the error control operator above.
* This seems to be the case only since PHP 8 */
}
}
}

0 comments on commit b8665ec

Please sign in to comment.