From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit@debian.org>
Date: Mon, 5 May 2025 11:24:19 +0200
Subject: RequiresPhpunit('< 11.5.18') for new failing tests

---
 tests/Functional/AutoIncrementColumnTest.php                 |  3 +++
 tests/Functional/Connection/ConnectionLostTest.php           |  2 ++
 tests/Functional/Connection/FetchEmptyTest.php               |  2 ++
 tests/Functional/Connection/FetchTest.php                    |  2 ++
 tests/Functional/DataAccessTest.php                          |  2 ++
 tests/Functional/FetchBooleanTest.php                        |  2 ++
 tests/Functional/ForeignKeyConstraintViolationsTest.php      |  2 ++
 tests/Functional/ForeignKeyExceptionTest.php                 |  2 ++
 tests/Functional/LockMode/NoneTest.php                       |  2 ++
 tests/Functional/ModifyLimitQueryTest.php                    | 11 +++++++++++
 tests/Functional/NamedParametersTest.php                     |  2 ++
 .../Platform/NewPrimaryKeyWithNewAutoIncrementColumnTest.php |  2 ++
 tests/Functional/PrimaryReadReplicaConnectionTest.php        |  2 ++
 tests/Functional/Query/QueryBuilderTest.php                  |  2 ++
 tests/Functional/ResultMetadataTest.php                      |  2 ++
 tests/Functional/Schema/ColumnCommentTest.php                |  2 ++
 tests/Functional/Schema/ComparatorTest.php                   |  2 ++
 tests/Functional/Schema/Db2SchemaManagerTest.php             |  2 ++
 tests/Functional/Schema/DefaultValueTest.php                 |  2 ++
 tests/Functional/Schema/MySQL/ComparatorTest.php             |  2 ++
 tests/Functional/Schema/MySQL/JsonCollationTest.php          |  2 ++
 tests/Functional/Schema/MySQLSchemaManagerTest.php           |  2 ++
 tests/Functional/Schema/Oracle/ComparatorTest.php            |  2 ++
 tests/Functional/Schema/OracleSchemaManagerTest.php          |  2 ++
 tests/Functional/Schema/PostgreSQL/ComparatorTest.php        |  2 ++
 tests/Functional/Schema/PostgreSQLSchemaManagerTest.php      |  2 ++
 tests/Functional/Schema/SQLServerSchemaManagerTest.php       |  2 ++
 tests/Functional/Schema/SQLite/ComparatorTest.php            |  2 ++
 tests/Functional/Schema/SQLiteSchemaManagerTest.php          |  2 ++
 tests/Functional/Schema/SchemaManagerTest.php                |  2 ++
 tests/Functional/StatementTest.php                           | 12 +++++++++++-
 tests/Functional/Ticket/DBAL202Test.php                      |  2 ++
 tests/Functional/Ticket/DBAL510Test.php                      |  2 ++
 tests/Functional/Ticket/DBAL752Test.php                      |  2 ++
 tests/Functional/TypeConversionTest.php                      |  2 ++
 tests/Functional/Types/AsciiStringTest.php                   |  2 ++
 tests/Functional/Types/EnumTypeTest.php                      |  5 +++++
 tests/Functional/Types/GuidTest.php                          |  2 ++
 tests/Functional/Types/JsonTest.php                          |  2 ++
 tests/Functional/UniqueConstraintViolationsTest.php          |  2 ++
 tests/Functional/WriteTest.php                               |  2 ++
 41 files changed, 104 insertions(+), 1 deletion(-)

diff --git a/tests/Functional/AutoIncrementColumnTest.php b/tests/Functional/AutoIncrementColumnTest.php
index 8a35201..d660cf5 100644
--- a/tests/Functional/AutoIncrementColumnTest.php
+++ b/tests/Functional/AutoIncrementColumnTest.php
@@ -11,6 +11,7 @@ use Doctrine\DBAL\Platforms\SQLServerPlatform;
 use Doctrine\DBAL\Schema\Table;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
 use Doctrine\DBAL\Types\Types;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
 class AutoIncrementColumnTest extends FunctionalTestCase
 {
@@ -38,6 +39,7 @@ class AutoIncrementColumnTest extends FunctionalTestCase
     }
 
     /** @throws Exception */
+    #[RequiresPhpunit('< 11.5.18')]
     public function testInsertAutoGeneratesValue(): void
     {
         $this->connection->insert('auto_increment_table', ['val' => 0]);
@@ -45,6 +47,7 @@ class AutoIncrementColumnTest extends FunctionalTestCase
     }
 
     /** @throws Exception */
+    #[RequiresPhpunit('< 11.5.18')]
     public function testInsertIdentityValue(): void
     {
         $platform    = $this->connection->getDatabasePlatform();
diff --git a/tests/Functional/Connection/ConnectionLostTest.php b/tests/Functional/Connection/ConnectionLostTest.php
index 78aa0c7..10b303a 100644
--- a/tests/Functional/Connection/ConnectionLostTest.php
+++ b/tests/Functional/Connection/ConnectionLostTest.php
@@ -7,9 +7,11 @@ namespace Doctrine\DBAL\Tests\Functional\Connection;
 use Doctrine\DBAL\Exception\ConnectionLost;
 use Doctrine\DBAL\Platforms\AbstractMySQLPlatform;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
 use function sleep;
 
+#[RequiresPhpunit('< 11.5.18')]
 class ConnectionLostTest extends FunctionalTestCase
 {
     protected function setUp(): void
diff --git a/tests/Functional/Connection/FetchEmptyTest.php b/tests/Functional/Connection/FetchEmptyTest.php
index f8b6d85..59d4065 100644
--- a/tests/Functional/Connection/FetchEmptyTest.php
+++ b/tests/Functional/Connection/FetchEmptyTest.php
@@ -5,9 +5,11 @@ declare(strict_types=1);
 namespace Doctrine\DBAL\Tests\Functional\Connection;
 
 use Doctrine\DBAL\Tests\FunctionalTestCase;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
 use function sprintf;
 
+#[RequiresPhpunit('< 11.5.18')]
 final class FetchEmptyTest extends FunctionalTestCase
 {
     private string $query;
diff --git a/tests/Functional/Connection/FetchTest.php b/tests/Functional/Connection/FetchTest.php
index dc2b849..913f57d 100644
--- a/tests/Functional/Connection/FetchTest.php
+++ b/tests/Functional/Connection/FetchTest.php
@@ -8,9 +8,11 @@ use Doctrine\DBAL\Exception\NoKeyValue;
 use Doctrine\DBAL\Platforms\SQLServerPlatform;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
 use Doctrine\DBAL\Tests\TestUtil;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
 use function iterator_to_array;
 
+#[RequiresPhpunit('< 11.5.18')]
 class FetchTest extends FunctionalTestCase
 {
     private string $query;
diff --git a/tests/Functional/DataAccessTest.php b/tests/Functional/DataAccessTest.php
index f12bf75..f454032 100644
--- a/tests/Functional/DataAccessTest.php
+++ b/tests/Functional/DataAccessTest.php
@@ -15,6 +15,7 @@ use Doctrine\DBAL\Statement;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
 use Doctrine\DBAL\Types\Types;
 use PHPUnit\Framework\Attributes\DataProvider;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
 use function array_change_key_case;
 use function date;
@@ -23,6 +24,7 @@ use function strtotime;
 
 use const CASE_LOWER;
 
+#[RequiresPhpunit('< 11.5.18')]
 class DataAccessTest extends FunctionalTestCase
 {
     protected function setUp(): void
diff --git a/tests/Functional/FetchBooleanTest.php b/tests/Functional/FetchBooleanTest.php
index 150c6fa..d0fa369 100644
--- a/tests/Functional/FetchBooleanTest.php
+++ b/tests/Functional/FetchBooleanTest.php
@@ -7,7 +7,9 @@ namespace Doctrine\DBAL\Tests\Functional;
 use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
 use PHPUnit\Framework\Attributes\DataProvider;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
+#[RequiresPhpunit('< 11.5.18')]
 class FetchBooleanTest extends FunctionalTestCase
 {
     protected function setUp(): void
diff --git a/tests/Functional/ForeignKeyConstraintViolationsTest.php b/tests/Functional/ForeignKeyConstraintViolationsTest.php
index 6db8cb1..3628843 100644
--- a/tests/Functional/ForeignKeyConstraintViolationsTest.php
+++ b/tests/Functional/ForeignKeyConstraintViolationsTest.php
@@ -16,10 +16,12 @@ use Doctrine\DBAL\Schema\ForeignKeyConstraint;
 use Doctrine\DBAL\Schema\Table;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
 use PHPUnit\Framework\Assert;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 use Throwable;
 
 use function sprintf;
 
+#[RequiresPhpunit('< 11.5.18')]
 final class ForeignKeyConstraintViolationsTest extends FunctionalTestCase
 {
     private string $constraintName = '';
diff --git a/tests/Functional/ForeignKeyExceptionTest.php b/tests/Functional/ForeignKeyExceptionTest.php
index 83e7d58..eca4be2 100644
--- a/tests/Functional/ForeignKeyExceptionTest.php
+++ b/tests/Functional/ForeignKeyExceptionTest.php
@@ -9,7 +9,9 @@ use Doctrine\DBAL\Driver\IBMDB2;
 use Doctrine\DBAL\Exception;
 use Doctrine\DBAL\Schema\Table;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
+#[RequiresPhpunit('< 11.5.18')]
 class ForeignKeyExceptionTest extends FunctionalTestCase
 {
     protected function setUp(): void
diff --git a/tests/Functional/LockMode/NoneTest.php b/tests/Functional/LockMode/NoneTest.php
index 9c4449b..eaf4416 100644
--- a/tests/Functional/LockMode/NoneTest.php
+++ b/tests/Functional/LockMode/NoneTest.php
@@ -15,7 +15,9 @@ use Doctrine\DBAL\Tests\FunctionalTestCase;
 use Doctrine\DBAL\Tests\TestUtil;
 use Doctrine\DBAL\TransactionIsolationLevel;
 use Doctrine\DBAL\Types\Types;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
+#[RequiresPhpunit('< 11.5.18')]
 class NoneTest extends FunctionalTestCase
 {
     private Connection $connection2;
diff --git a/tests/Functional/ModifyLimitQueryTest.php b/tests/Functional/ModifyLimitQueryTest.php
index 75c9607..a0eab74 100644
--- a/tests/Functional/ModifyLimitQueryTest.php
+++ b/tests/Functional/ModifyLimitQueryTest.php
@@ -10,6 +10,7 @@ use Doctrine\DBAL\Platforms\SQLServerPlatform;
 use Doctrine\DBAL\Schema\Table;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
 use Doctrine\DBAL\Types\Types;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
 use function array_change_key_case;
 use function count;
@@ -33,6 +34,7 @@ class ModifyLimitQueryTest extends FunctionalTestCase
         $this->dropAndCreateTable($table2);
     }
 
+    #[RequiresPhpunit('< 11.5.18')]
     public function testModifyLimitQuerySimpleQuery(): void
     {
         $this->connection->insert('modify_limit_table', ['test_int' => 1]);
@@ -48,6 +50,7 @@ class ModifyLimitQueryTest extends FunctionalTestCase
         $this->assertLimitResult([2, 3, 4], $sql, null, 1);
     }
 
+    #[RequiresPhpunit('< 11.5.18')]
     public function testModifyLimitQueryJoinQuery(): void
     {
         $this->connection->insert('modify_limit_table', ['test_int' => 1]);
@@ -70,6 +73,7 @@ class ModifyLimitQueryTest extends FunctionalTestCase
         $this->assertLimitResult([2, 2], $sql, 2, 0);
     }
 
+    #[RequiresPhpunit('< 11.5.18')]
     public function testModifyLimitQueryNonDeterministic(): void
     {
         $this->connection->insert('modify_limit_table', ['test_int' => 1]);
@@ -84,6 +88,7 @@ class ModifyLimitQueryTest extends FunctionalTestCase
         $this->assertLimitResult([2, 1], $sql, 2, 2, false);
     }
 
+    #[RequiresPhpunit('< 11.5.18')]
     public function testModifyLimitQueryGroupBy(): void
     {
         $this->connection->insert('modify_limit_table', ['test_int' => 1]);
@@ -104,6 +109,7 @@ class ModifyLimitQueryTest extends FunctionalTestCase
         $this->assertLimitResult([2], $sql, 1, 1);
     }
 
+    #[RequiresPhpunit('< 11.5.18')]
     public function testModifyLimitQuerySubSelect(): void
     {
         $this->connection->insert('modify_limit_table', ['test_int' => 1]);
@@ -119,6 +125,7 @@ class ModifyLimitQueryTest extends FunctionalTestCase
         $this->assertLimitResult([2, 1], $sql, 2, 2);
     }
 
+    #[RequiresPhpunit('< 11.5.18')]
     public function testModifyLimitQueryFromSubSelect(): void
     {
         $this->connection->insert('modify_limit_table', ['test_int' => 1]);
@@ -133,6 +140,7 @@ class ModifyLimitQueryTest extends FunctionalTestCase
         $this->assertLimitResult([2, 1], $sql, 2, 2);
     }
 
+    #[RequiresPhpunit('< 11.5.18')]
     public function testModifyLimitQueryLineBreaks(): void
     {
         $this->connection->insert('modify_limit_table', ['test_int' => 1]);
@@ -153,6 +161,7 @@ SQL;
         $this->assertLimitResult([2], $sql, 1, 1);
     }
 
+    #[RequiresPhpunit('< 11.5.18')]
     public function testModifyLimitQueryZeroOffsetNoLimit(): void
     {
         $this->connection->insert('modify_limit_table', ['test_int' => 1]);
@@ -164,6 +173,7 @@ SQL;
     }
 
     /** @param array<int, int> $expectedResults */
+    #[RequiresPhpunit('< 11.5.18')]
     private function assertLimitResult(
         array $expectedResults,
         string $sql,
@@ -188,6 +198,7 @@ SQL;
         }
     }
 
+    #[RequiresPhpunit('< 11.5.18')]
     public function testLimitWhenOrderByWithSubqueryWithOrderBy(): void
     {
         $platform = $this->connection->getDatabasePlatform();
diff --git a/tests/Functional/NamedParametersTest.php b/tests/Functional/NamedParametersTest.php
index cc7fb8e..cd2a3af 100644
--- a/tests/Functional/NamedParametersTest.php
+++ b/tests/Functional/NamedParametersTest.php
@@ -11,12 +11,14 @@ use Doctrine\DBAL\Schema\Table;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
 use Doctrine\DBAL\Types\Types;
 use PHPUnit\Framework\Attributes\DataProvider;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 use Throwable;
 
 use function array_change_key_case;
 
 use const CASE_LOWER;
 
+#[RequiresPhpunit('< 11.5.18')]
 /** @phpstan-import-type WrapperParameterType from Connection */
 class NamedParametersTest extends FunctionalTestCase
 {
diff --git a/tests/Functional/Platform/NewPrimaryKeyWithNewAutoIncrementColumnTest.php b/tests/Functional/Platform/NewPrimaryKeyWithNewAutoIncrementColumnTest.php
index 45da1a1..ee0a32e 100644
--- a/tests/Functional/Platform/NewPrimaryKeyWithNewAutoIncrementColumnTest.php
+++ b/tests/Functional/Platform/NewPrimaryKeyWithNewAutoIncrementColumnTest.php
@@ -8,6 +8,7 @@ use Doctrine\DBAL\Platforms\AbstractMySQLPlatform;
 use Doctrine\DBAL\Platforms\AbstractPlatform;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
 use Doctrine\DBAL\Types\Types;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
 final class NewPrimaryKeyWithNewAutoIncrementColumnTest extends FunctionalTestCase
 {
@@ -28,6 +29,7 @@ final class NewPrimaryKeyWithNewAutoIncrementColumnTest extends FunctionalTestCa
      * SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table definition; there can be only one auto
      * column and it must be defined as a key
      */
+    #[RequiresPhpunit('< 11.5.18')]
     public function testAlterPrimaryKeyToAutoIncrementColumn(): void
     {
         $this->dropTableIfExists('dbal2807');
diff --git a/tests/Functional/PrimaryReadReplicaConnectionTest.php b/tests/Functional/PrimaryReadReplicaConnectionTest.php
index 6d4241f..984ec82 100644
--- a/tests/Functional/PrimaryReadReplicaConnectionTest.php
+++ b/tests/Functional/PrimaryReadReplicaConnectionTest.php
@@ -10,6 +10,7 @@ use Doctrine\DBAL\Platforms\AbstractMySQLPlatform;
 use Doctrine\DBAL\Schema\Table;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
 use Doctrine\DBAL\Types\Types;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 use Throwable;
 
 use function array_change_key_case;
@@ -17,6 +18,7 @@ use function array_change_key_case;
 use const CASE_LOWER;
 
 /** @phpstan-import-type Params from DriverManager */
+#[RequiresPhpunit('< 11.5.18')]
 class PrimaryReadReplicaConnectionTest extends FunctionalTestCase
 {
     protected function setUp(): void
diff --git a/tests/Functional/Query/QueryBuilderTest.php b/tests/Functional/Query/QueryBuilderTest.php
index b54a937..dab1c58 100644
--- a/tests/Functional/Query/QueryBuilderTest.php
+++ b/tests/Functional/Query/QueryBuilderTest.php
@@ -19,11 +19,13 @@ use Doctrine\DBAL\Schema\Table;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
 use Doctrine\DBAL\Tests\TestUtil;
 use Doctrine\DBAL\Types\Types;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
 use function array_change_key_case;
 
 use const CASE_UPPER;
 
+#[RequiresPhpunit('< 11.5.18')]
 final class QueryBuilderTest extends FunctionalTestCase
 {
     protected function setUp(): void
diff --git a/tests/Functional/ResultMetadataTest.php b/tests/Functional/ResultMetadataTest.php
index e0b9f6f..ff8be2b 100644
--- a/tests/Functional/ResultMetadataTest.php
+++ b/tests/Functional/ResultMetadataTest.php
@@ -7,10 +7,12 @@ namespace Doctrine\DBAL\Tests\Functional;
 use Doctrine\DBAL\Exception\InvalidColumnIndex;
 use Doctrine\DBAL\Schema\Table;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 use PHPUnit\Framework\Attributes\TestWith;
 
 use function strtolower;
 
+#[RequiresPhpunit('< 11.5.18')]
 class ResultMetadataTest extends FunctionalTestCase
 {
     protected function setUp(): void
diff --git a/tests/Functional/Schema/ColumnCommentTest.php b/tests/Functional/Schema/ColumnCommentTest.php
index d489ef6..7b59dbd 100644
--- a/tests/Functional/Schema/ColumnCommentTest.php
+++ b/tests/Functional/Schema/ColumnCommentTest.php
@@ -7,10 +7,12 @@ namespace Doctrine\DBAL\Tests\Functional\Schema;
 use Doctrine\DBAL\Schema\Table;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
 use PHPUnit\Framework\Attributes\DataProvider;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
 use function array_merge;
 use function sprintf;
 
+#[RequiresPhpunit('< 11.5.18')]
 class ColumnCommentTest extends FunctionalTestCase
 {
     private static bool $initialized = false;
diff --git a/tests/Functional/Schema/ComparatorTest.php b/tests/Functional/Schema/ComparatorTest.php
index da7244a..2592766 100644
--- a/tests/Functional/Schema/ComparatorTest.php
+++ b/tests/Functional/Schema/ComparatorTest.php
@@ -14,7 +14,9 @@ use Doctrine\DBAL\Tests\FunctionalTestCase;
 use Doctrine\DBAL\Types\Type;
 use Doctrine\DBAL\Types\Types;
 use PHPUnit\Framework\Attributes\DataProvider;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
+#[RequiresPhpunit('< 11.5.18')]
 class ComparatorTest extends FunctionalTestCase
 {
     private AbstractSchemaManager $schemaManager;
diff --git a/tests/Functional/Schema/Db2SchemaManagerTest.php b/tests/Functional/Schema/Db2SchemaManagerTest.php
index fafe709..6703dc6 100644
--- a/tests/Functional/Schema/Db2SchemaManagerTest.php
+++ b/tests/Functional/Schema/Db2SchemaManagerTest.php
@@ -7,7 +7,9 @@ namespace Doctrine\DBAL\Tests\Functional\Schema;
 use Doctrine\DBAL\Exception;
 use Doctrine\DBAL\Platforms\AbstractPlatform;
 use Doctrine\DBAL\Platforms\DB2Platform;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
+#[RequiresPhpunit('< 11.5.18')]
 class Db2SchemaManagerTest extends SchemaManagerFunctionalTestCase
 {
     protected function supportsPlatform(AbstractPlatform $platform): bool
diff --git a/tests/Functional/Schema/DefaultValueTest.php b/tests/Functional/Schema/DefaultValueTest.php
index 07413e8..504cd47 100644
--- a/tests/Functional/Schema/DefaultValueTest.php
+++ b/tests/Functional/Schema/DefaultValueTest.php
@@ -8,9 +8,11 @@ use Doctrine\DBAL\Schema\Table;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
 use Doctrine\DBAL\Types\Types;
 use PHPUnit\Framework\Attributes\DataProvider;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
 use function sprintf;
 
+#[RequiresPhpunit('< 11.5.18')]
 class DefaultValueTest extends FunctionalTestCase
 {
     protected function setUp(): void
diff --git a/tests/Functional/Schema/MySQL/ComparatorTest.php b/tests/Functional/Schema/MySQL/ComparatorTest.php
index a1364bd..22caab0 100644
--- a/tests/Functional/Schema/MySQL/ComparatorTest.php
+++ b/tests/Functional/Schema/MySQL/ComparatorTest.php
@@ -17,7 +17,9 @@ use Doctrine\DBAL\Tests\Functional\Schema\ComparatorTestUtils;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
 use Doctrine\DBAL\Types\Types;
 use PHPUnit\Framework\Attributes\DataProvider;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
+#[RequiresPhpunit('< 11.5.18')]
 final class ComparatorTest extends FunctionalTestCase
 {
     private AbstractPlatform $platform;
diff --git a/tests/Functional/Schema/MySQL/JsonCollationTest.php b/tests/Functional/Schema/MySQL/JsonCollationTest.php
index fe8b9b5..d29d3d5 100644
--- a/tests/Functional/Schema/MySQL/JsonCollationTest.php
+++ b/tests/Functional/Schema/MySQL/JsonCollationTest.php
@@ -13,6 +13,7 @@ use Doctrine\DBAL\Tests\FunctionalTestCase;
 use Doctrine\DBAL\Types\Types;
 use Iterator;
 use PHPUnit\Framework\Attributes\DataProvider;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
 use function array_filter;
 
@@ -20,6 +21,7 @@ use function array_filter;
  * Tests that character set and collation are ignored for columns declared as native JSON in MySQL and
  * MariaDb and cannot be changed.
  */
+#[RequiresPhpunit('< 11.5.18')]
 final class JsonCollationTest extends FunctionalTestCase
 {
     private AbstractPlatform $platform;
diff --git a/tests/Functional/Schema/MySQLSchemaManagerTest.php b/tests/Functional/Schema/MySQLSchemaManagerTest.php
index 893f673..a6a3829 100644
--- a/tests/Functional/Schema/MySQLSchemaManagerTest.php
+++ b/tests/Functional/Schema/MySQLSchemaManagerTest.php
@@ -20,9 +20,11 @@ use Doctrine\DBAL\Types\JsonType;
 use Doctrine\DBAL\Types\SmallFloatType;
 use Doctrine\DBAL\Types\Type;
 use Doctrine\DBAL\Types\Types;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
 use function array_keys;
 
+#[RequiresPhpunit('< 11.5.18')]
 class MySQLSchemaManagerTest extends SchemaManagerFunctionalTestCase
 {
     public static function setUpBeforeClass(): void
diff --git a/tests/Functional/Schema/Oracle/ComparatorTest.php b/tests/Functional/Schema/Oracle/ComparatorTest.php
index c84d6a0..90c6f69 100644
--- a/tests/Functional/Schema/Oracle/ComparatorTest.php
+++ b/tests/Functional/Schema/Oracle/ComparatorTest.php
@@ -11,7 +11,9 @@ use Doctrine\DBAL\Schema\Table;
 use Doctrine\DBAL\Tests\Functional\Schema\ComparatorTestUtils;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
 use Doctrine\DBAL\Types\Types;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
+#[RequiresPhpunit('< 11.5.18')]
 final class ComparatorTest extends FunctionalTestCase
 {
     private AbstractSchemaManager $schemaManager;
diff --git a/tests/Functional/Schema/OracleSchemaManagerTest.php b/tests/Functional/Schema/OracleSchemaManagerTest.php
index 967a169..5222a52 100644
--- a/tests/Functional/Schema/OracleSchemaManagerTest.php
+++ b/tests/Functional/Schema/OracleSchemaManagerTest.php
@@ -15,9 +15,11 @@ use Doctrine\DBAL\Types\DateTimeType;
 use Doctrine\DBAL\Types\DateTimeTzType;
 use Doctrine\DBAL\Types\DateType;
 use Doctrine\DBAL\Types\Types;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
 use function array_map;
 
+#[RequiresPhpunit('< 11.5.18')]
 class OracleSchemaManagerTest extends SchemaManagerFunctionalTestCase
 {
     protected function supportsPlatform(AbstractPlatform $platform): bool
diff --git a/tests/Functional/Schema/PostgreSQL/ComparatorTest.php b/tests/Functional/Schema/PostgreSQL/ComparatorTest.php
index b6e598d..16a79a9 100644
--- a/tests/Functional/Schema/PostgreSQL/ComparatorTest.php
+++ b/tests/Functional/Schema/PostgreSQL/ComparatorTest.php
@@ -13,7 +13,9 @@ use Doctrine\DBAL\Tests\Functional\Schema\ComparatorTestUtils;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
 use Doctrine\DBAL\Types\Type;
 use Doctrine\DBAL\Types\Types;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
+#[RequiresPhpunit('< 11.5.18')]
 final class ComparatorTest extends FunctionalTestCase
 {
     private AbstractSchemaManager $schemaManager;
diff --git a/tests/Functional/Schema/PostgreSQLSchemaManagerTest.php b/tests/Functional/Schema/PostgreSQLSchemaManagerTest.php
index dba9d6b..2cec86b 100644
--- a/tests/Functional/Schema/PostgreSQLSchemaManagerTest.php
+++ b/tests/Functional/Schema/PostgreSQLSchemaManagerTest.php
@@ -20,6 +20,7 @@ use Doctrine\DBAL\Types\TextType;
 use Doctrine\DBAL\Types\Type;
 use Doctrine\DBAL\Types\Types;
 use PHPUnit\Framework\Attributes\DataProvider;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
 use function array_map;
 use function count;
@@ -27,6 +28,7 @@ use function sprintf;
 use function strtolower;
 use function version_compare;
 
+#[RequiresPhpunit('< 11.5.18')]
 class PostgreSQLSchemaManagerTest extends SchemaManagerFunctionalTestCase
 {
     protected function supportsPlatform(AbstractPlatform $platform): bool
diff --git a/tests/Functional/Schema/SQLServerSchemaManagerTest.php b/tests/Functional/Schema/SQLServerSchemaManagerTest.php
index 3cd8f32..b82e04a 100644
--- a/tests/Functional/Schema/SQLServerSchemaManagerTest.php
+++ b/tests/Functional/Schema/SQLServerSchemaManagerTest.php
@@ -8,9 +8,11 @@ use Doctrine\DBAL\Platforms\AbstractPlatform;
 use Doctrine\DBAL\Platforms\SQLServerPlatform;
 use Doctrine\DBAL\Schema\Table;
 use Doctrine\DBAL\Types\Types;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
 use function array_shift;
 
+#[RequiresPhpunit('< 11.5.18')]
 class SQLServerSchemaManagerTest extends SchemaManagerFunctionalTestCase
 {
     protected function supportsPlatform(AbstractPlatform $platform): bool
diff --git a/tests/Functional/Schema/SQLite/ComparatorTest.php b/tests/Functional/Schema/SQLite/ComparatorTest.php
index 88afe1c..eb35223 100644
--- a/tests/Functional/Schema/SQLite/ComparatorTest.php
+++ b/tests/Functional/Schema/SQLite/ComparatorTest.php
@@ -12,7 +12,9 @@ use Doctrine\DBAL\Schema\Table;
 use Doctrine\DBAL\Tests\Functional\Schema\ComparatorTestUtils;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
 use Doctrine\DBAL\Types\Types;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
+#[RequiresPhpunit('< 11.5.18')]
 final class ComparatorTest extends FunctionalTestCase
 {
     private AbstractPlatform $platform;
diff --git a/tests/Functional/Schema/SQLiteSchemaManagerTest.php b/tests/Functional/Schema/SQLiteSchemaManagerTest.php
index d9d57f4..12340cc 100644
--- a/tests/Functional/Schema/SQLiteSchemaManagerTest.php
+++ b/tests/Functional/Schema/SQLiteSchemaManagerTest.php
@@ -15,10 +15,12 @@ use Doctrine\DBAL\Schema\TableDiff;
 use Doctrine\DBAL\Types\BlobType;
 use Doctrine\DBAL\Types\Type;
 use Doctrine\DBAL\Types\Types;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
 use function array_keys;
 use function array_shift;
 
+#[RequiresPhpunit('< 11.5.18')]
 class SQLiteSchemaManagerTest extends SchemaManagerFunctionalTestCase
 {
     protected function supportsPlatform(AbstractPlatform $platform): bool
diff --git a/tests/Functional/Schema/SchemaManagerTest.php b/tests/Functional/Schema/SchemaManagerTest.php
index a35a093..f3bbd62 100644
--- a/tests/Functional/Schema/SchemaManagerTest.php
+++ b/tests/Functional/Schema/SchemaManagerTest.php
@@ -10,7 +10,9 @@ use Doctrine\DBAL\Schema\Table;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
 use Doctrine\DBAL\Types\Types;
 use PHPUnit\Framework\Attributes\DataProvider;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
+#[RequiresPhpunit('< 11.5.18')]
 final class SchemaManagerTest extends FunctionalTestCase
 {
     private AbstractSchemaManager $schemaManager;
diff --git a/tests/Functional/StatementTest.php b/tests/Functional/StatementTest.php
index ec6bd94..49a4c7c 100644
--- a/tests/Functional/StatementTest.php
+++ b/tests/Functional/StatementTest.php
@@ -34,6 +34,7 @@ class StatementTest extends FunctionalTestCase
         $this->dropAndCreateTable($table);
     }
 
+    #[RequiresPhpunit('< 11.5.18')]
     public function testStatementIsReusableAfterFreeingResult(): void
     {
         if (TestUtil::isDriverOneOf('pdo_oci')) {
@@ -57,6 +58,7 @@ class StatementTest extends FunctionalTestCase
         self::assertEquals(2, $result->fetchOne());
     }
 
+    #[RequiresPhpunit('< 11.5.18')]
     public function testReuseStatementWithLongerResults(): void
     {
         if (TestUtil::isDriverOneOf('pdo_oci')) {
@@ -141,6 +143,7 @@ EOF
         self::assertSame($contents, stream_get_contents($stream));
     }
 
+    #[RequiresPhpunit('< 11.5.18')]
     public function testIncompletelyFetchedStatementDoesNotBlockConnection(): void
     {
         $this->connection->insert('stmt_test', ['id' => 1]);
@@ -157,6 +160,7 @@ EOF
         self::assertEquals(1, $this->connection->fetchOne('SELECT id FROM stmt_test WHERE id = ?', [1]));
     }
 
+    #[RequiresPhpunit('< 11.5.18')]
     public function testReuseStatementAfterFreeingResult(): void
     {
         if (TestUtil::isDriverOneOf('pdo_oci')) {
@@ -183,6 +187,7 @@ EOF
         self::assertEquals(2, $id);
     }
 
+    #[RequiresPhpunit('< 11.5.18')]
     public function testReuseStatementWithReboundValue(): void
     {
         $this->connection->insert('stmt_test', ['id' => 1]);
@@ -199,6 +204,7 @@ EOF
         self::assertEquals(2, $result->fetchOne());
     }
 
+    #[RequiresPhpunit('< 11.5.18')]
     public function testBindInvalidNamedParameter(): void
     {
         if (TestUtil::isDriverOneOf('ibm_db2', 'mysqli', 'pgsql', 'sqlsrv')) {
@@ -218,6 +224,7 @@ EOF
         $statement->executeQuery();
     }
 
+    #[RequiresPhpunit('< 11.5.18')]
     public function testParameterBindingOrder(): void
     {
         $platform = $this->connection->getDatabasePlatform();
@@ -237,6 +244,7 @@ EOF
         self::assertEquals([5, 6], $stmt->executeQuery()->fetchNumeric());
     }
 
+    #[RequiresPhpunit('< 11.5.18')]
     public function testFetchInColumnMode(): void
     {
         $platform = $this->connection->getDatabasePlatform();
@@ -256,7 +264,7 @@ EOF
      * 1. Not all underlying drivers report this as an error.
      * 2. It is a logical error which requires a code change and should not be handled at runtime.
      */
-    #[RequiresPhpunit('< 12')]
+    #[RequiresPhpunit('< 11.5.18')]
     public function testExecWithRedundantParameters(): void
     {
         $driver = $this->connection->getDriver();
@@ -298,6 +306,7 @@ EOF
         $stmt->executeQuery();
     }
 
+    #[RequiresPhpunit('< 11.5.18')]
     public function testExecuteQuery(): void
     {
         $platform = $this->connection->getDatabasePlatform();
@@ -307,6 +316,7 @@ EOF
         self::assertEquals(1, $result);
     }
 
+    #[RequiresPhpunit('< 11.5.18')]
     public function testExecuteStatement(): void
     {
         $this->connection->insert('stmt_test', ['id' => 1]);
diff --git a/tests/Functional/Ticket/DBAL202Test.php b/tests/Functional/Ticket/DBAL202Test.php
index 8d9ceef..d3587e4 100644
--- a/tests/Functional/Ticket/DBAL202Test.php
+++ b/tests/Functional/Ticket/DBAL202Test.php
@@ -8,7 +8,9 @@ use Doctrine\DBAL\Platforms\OraclePlatform;
 use Doctrine\DBAL\Schema\Table;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
 use Doctrine\DBAL\Types\Types;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
+#[RequiresPhpunit('< 11.5.18')]
 class DBAL202Test extends FunctionalTestCase
 {
     protected function setUp(): void
diff --git a/tests/Functional/Ticket/DBAL510Test.php b/tests/Functional/Ticket/DBAL510Test.php
index 3897f72..f685ee1 100644
--- a/tests/Functional/Ticket/DBAL510Test.php
+++ b/tests/Functional/Ticket/DBAL510Test.php
@@ -8,7 +8,9 @@ use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
 use Doctrine\DBAL\Schema\Table;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
 use Doctrine\DBAL\Types\Types;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
+#[RequiresPhpunit('< 11.5.18')]
 class DBAL510Test extends FunctionalTestCase
 {
     protected function setUp(): void
diff --git a/tests/Functional/Ticket/DBAL752Test.php b/tests/Functional/Ticket/DBAL752Test.php
index 71fc6ff..fbe0bd4 100644
--- a/tests/Functional/Ticket/DBAL752Test.php
+++ b/tests/Functional/Ticket/DBAL752Test.php
@@ -9,7 +9,9 @@ use Doctrine\DBAL\Tests\FunctionalTestCase;
 use Doctrine\DBAL\Types\BigIntType;
 use Doctrine\DBAL\Types\IntegerType;
 use Doctrine\DBAL\Types\SmallIntType;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
+#[RequiresPhpunit('< 11.5.18')]
 class DBAL752Test extends FunctionalTestCase
 {
     protected function setUp(): void
diff --git a/tests/Functional/TypeConversionTest.php b/tests/Functional/TypeConversionTest.php
index 7a577fa..2b9419b 100644
--- a/tests/Functional/TypeConversionTest.php
+++ b/tests/Functional/TypeConversionTest.php
@@ -11,9 +11,11 @@ use Doctrine\DBAL\Tests\TestUtil;
 use Doctrine\DBAL\Types\Type;
 use Doctrine\DBAL\Types\Types;
 use PHPUnit\Framework\Attributes\DataProvider;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
 use function str_repeat;
 
+#[RequiresPhpunit('< 11.5.18')]
 class TypeConversionTest extends FunctionalTestCase
 {
     private static int $typeCounter = 0;
diff --git a/tests/Functional/Types/AsciiStringTest.php b/tests/Functional/Types/AsciiStringTest.php
index 9c66a6c..c1222b8 100644
--- a/tests/Functional/Types/AsciiStringTest.php
+++ b/tests/Functional/Types/AsciiStringTest.php
@@ -8,6 +8,7 @@ use Doctrine\DBAL\ParameterType;
 use Doctrine\DBAL\Schema\Table;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
 use Doctrine\DBAL\Types\Types;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
 class AsciiStringTest extends FunctionalTestCase
 {
@@ -25,6 +26,7 @@ class AsciiStringTest extends FunctionalTestCase
         $this->dropAndCreateTable($table);
     }
 
+    #[RequiresPhpunit('< 11.5.18')]
     public function testInsertAndSelect(): void
     {
         $id1 = 'id1';
diff --git a/tests/Functional/Types/EnumTypeTest.php b/tests/Functional/Types/EnumTypeTest.php
index 0f73b42..867d6e4 100644
--- a/tests/Functional/Types/EnumTypeTest.php
+++ b/tests/Functional/Types/EnumTypeTest.php
@@ -12,6 +12,7 @@ use Doctrine\DBAL\Types\EnumType;
 use Doctrine\DBAL\Types\Type;
 use Doctrine\DBAL\Types\Types;
 use PHPUnit\Framework\Attributes\DataProvider;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
 final class EnumTypeTest extends FunctionalTestCase
 {
@@ -20,6 +21,7 @@ final class EnumTypeTest extends FunctionalTestCase
         $this->dropTableIfExists('my_enum_table');
     }
 
+    #[RequiresPhpunit('< 11.5.18')]
     public function testIntrospectEnum(): void
     {
         if (! $this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform) {
@@ -43,6 +45,7 @@ final class EnumTypeTest extends FunctionalTestCase
         self::assertSame('hearts', $table->getColumn('suit')->getDefault());
     }
 
+    #[RequiresPhpunit('< 11.5.18')]
     public function testDeployEnum(): void
     {
         $schemaManager = $this->connection->createSchemaManager();
@@ -75,6 +78,7 @@ final class EnumTypeTest extends FunctionalTestCase
         );
     }
 
+    #[RequiresPhpunit('< 11.5.18')]
     public function testDeployEmptyEnum(): void
     {
         $schemaManager = $this->connection->createSchemaManager();
@@ -91,6 +95,7 @@ final class EnumTypeTest extends FunctionalTestCase
 
     /** @param list<string> $expectedValues */
     #[DataProvider('provideEnumDefinitions')]
+    #[RequiresPhpunit('< 11.5.18')]
     public function testIntrospectEnumValues(string $definition, array $expectedValues): void
     {
         if (! $this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform) {
diff --git a/tests/Functional/Types/GuidTest.php b/tests/Functional/Types/GuidTest.php
index 57845f0..8756763 100644
--- a/tests/Functional/Types/GuidTest.php
+++ b/tests/Functional/Types/GuidTest.php
@@ -7,6 +7,7 @@ namespace Doctrine\DBAL\Tests\Functional\Types;
 use Doctrine\DBAL\Schema\Table;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
 use Doctrine\DBAL\Types\Types;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
 class GuidTest extends FunctionalTestCase
 {
@@ -18,6 +19,7 @@ class GuidTest extends FunctionalTestCase
         $this->dropAndCreateTable($table);
     }
 
+    #[RequiresPhpunit('< 11.5.18')]
     public function testInsertAndSelect(): void
     {
         $guid = '7c620eda-ea79-11eb-9a03-0242ac130003';
diff --git a/tests/Functional/Types/JsonTest.php b/tests/Functional/Types/JsonTest.php
index 45dc424..f3da365 100644
--- a/tests/Functional/Types/JsonTest.php
+++ b/tests/Functional/Types/JsonTest.php
@@ -9,6 +9,7 @@ use Doctrine\DBAL\Schema\Table;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
 use Doctrine\DBAL\Types\Type;
 use Doctrine\DBAL\Types\Types;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
 use function is_resource;
 use function json_decode;
@@ -28,6 +29,7 @@ class JsonTest extends FunctionalTestCase
         $this->dropAndCreateTable($table);
     }
 
+    #[RequiresPhpunit('< 11.5.18')]
     public function testInsertAndSelect(): void
     {
         $id1 = 1;
diff --git a/tests/Functional/UniqueConstraintViolationsTest.php b/tests/Functional/UniqueConstraintViolationsTest.php
index ed756cd..8f82484 100644
--- a/tests/Functional/UniqueConstraintViolationsTest.php
+++ b/tests/Functional/UniqueConstraintViolationsTest.php
@@ -18,9 +18,11 @@ use Doctrine\DBAL\Schema\UniqueConstraint;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
 use PHPUnit\Framework\Assert;
 use Throwable;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
 use function sprintf;
 
+#[RequiresPhpunit('< 11.5.18')]
 final class UniqueConstraintViolationsTest extends FunctionalTestCase
 {
     private string $constraintName = '';
diff --git a/tests/Functional/WriteTest.php b/tests/Functional/WriteTest.php
index 8555e44..46a9911 100644
--- a/tests/Functional/WriteTest.php
+++ b/tests/Functional/WriteTest.php
@@ -15,8 +15,10 @@ use Doctrine\DBAL\Schema\Table;
 use Doctrine\DBAL\Tests\FunctionalTestCase;
 use Doctrine\DBAL\Tests\TestUtil;
 use Doctrine\DBAL\Types\Types;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 use Throwable;
 
+#[RequiresPhpunit('< 11.5.18')]
 class WriteTest extends FunctionalTestCase
 {
     protected function setUp(): void
