diff --git a/tests/Functional/PortabilityTest.php b/tests/Functional/PortabilityTest.php index 9a11859f5b6..3fef5445a11 100644 --- a/tests/Functional/PortabilityTest.php +++ b/tests/Functional/PortabilityTest.php @@ -49,7 +49,9 @@ protected function setUp(): void protected function tearDown(): void { - $this->markConnectionNotReusable(); + // the connection that overrides the shared one has to be manually closed prior to 4.0.0 to prevent leak + // see https://github.com/doctrine/dbal/issues/4515 + $this->connection->close(); } public function testFullFetchMode(): void diff --git a/tests/Functional/Schema/MySQLSchemaManagerTest.php b/tests/Functional/Schema/MySQLSchemaManagerTest.php index 5a960a23378..5f0d722bc65 100644 --- a/tests/Functional/Schema/MySQLSchemaManagerTest.php +++ b/tests/Functional/Schema/MySQLSchemaManagerTest.php @@ -21,11 +21,6 @@ public static function setUpBeforeClass(): void Type::addType('point', PointType::class); } - protected function tearDown(): void - { - $this->markConnectionNotReusable(); - } - protected function supportsPlatform(AbstractPlatform $platform): bool { return $platform instanceof MySQLPlatform; @@ -106,6 +101,9 @@ public function testSpatialIndex(): void $this->schemaManager->dropAndCreateTable($table); + // see https://github.com/doctrine/dbal/issues/4983 + $this->markConnectionNotReusable(); + $indexes = $this->schemaManager->listTableIndexes('spatial_index'); self::assertArrayHasKey('s_index', $indexes); self::assertTrue($indexes['s_index']->hasFlag('spatial')); diff --git a/tests/Functional/Schema/PostgreSQLSchemaManagerTest.php b/tests/Functional/Schema/PostgreSQLSchemaManagerTest.php index 831af69c0ac..c9ce4aeb3ab 100644 --- a/tests/Functional/Schema/PostgreSQLSchemaManagerTest.php +++ b/tests/Functional/Schema/PostgreSQLSchemaManagerTest.php @@ -198,6 +198,8 @@ public function testFilterSchemaExpression(): void $testTable->addColumn('id', 'integer'); $this->schemaManager->createTable($testTable); + $this->markConnectionNotReusable(); + $this->connection->getConfiguration()->setSchemaAssetsFilter(static function (string $name): bool { return preg_match('#^dbal204_#', $name) === 1; }); diff --git a/tests/Functional/Schema/SchemaManagerFunctionalTestCase.php b/tests/Functional/Schema/SchemaManagerFunctionalTestCase.php index e578e06ba3c..d5a809abc50 100644 --- a/tests/Functional/Schema/SchemaManagerFunctionalTestCase.php +++ b/tests/Functional/Schema/SchemaManagerFunctionalTestCase.php @@ -78,8 +78,6 @@ protected function tearDown(): void $this->connection->executeStatement('DROP SCHEMA testschema'); } catch (Exception $e) { } - - $this->markConnectionNotReusable(); } public function testDropAndCreateSequence(): void