From d278c6b38c64d3917a55ba3b4fe6676f4d30f0ca Mon Sep 17 00:00:00 2001 From: Herberto Graca Date: Mon, 25 Sep 2023 22:34:27 +0200 Subject: [PATCH] fixup! --- tests/Functional/Query/QueryBuilderTest.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/Functional/Query/QueryBuilderTest.php b/tests/Functional/Query/QueryBuilderTest.php index 9e1a8368811..53004b8fcc1 100644 --- a/tests/Functional/Query/QueryBuilderTest.php +++ b/tests/Functional/Query/QueryBuilderTest.php @@ -4,16 +4,29 @@ namespace Doctrine\DBAL\Tests\Functional\Query; +use Doctrine\DBAL\Platforms\AbstractPlatform; +use Doctrine\DBAL\Platforms\DB2Platform; +use Doctrine\DBAL\Platforms\MariaDb1027Platform; +use Doctrine\DBAL\Platforms\MySQL57Platform; +use Doctrine\DBAL\Platforms\SqlitePlatform; use Doctrine\DBAL\Query\QueryBuilder; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Tests\FunctionalTestCase; use Doctrine\DBAL\Tests\TestUtil; use Doctrine\DBAL\Types\Types; +use function get_class; +use function sprintf; + final class QueryBuilderTest extends FunctionalTestCase { protected function setUp(): void { + $platform = $this->connection->getDatabasePlatform(); + if (! $this->supportsPlatform($platform)) { + self::markTestSkipped(sprintf('Skipping since connected to %s', get_class($platform))); + } + $tableName = 'users'; $table = new Table($tableName); $table->addColumn('id', Types::INTEGER, ['autoincrement' => true]); @@ -26,6 +39,14 @@ protected function setUp(): void $this->connection->insert($tableName, ['nickname' => 'bbb']); } + private function supportsPlatform(AbstractPlatform $platform): bool + { + return ! $platform instanceof DB2Platform + && ! $platform instanceof MariaDb1027Platform + && ! $platform instanceof MySQL57Platform + && ! $platform instanceof SqlitePlatform; + } + public function testConcurrentConnectionSkipsLockedRows(): void { $connection1 = $this->connection;