Skip to content

Commit

Permalink
Optimize sharing test connection
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Nov 15, 2021
1 parent 10df50f commit 06f5925
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions tests/Functional/Schema/MySQLSchemaManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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'));
Expand Down
2 changes: 2 additions & 0 deletions tests/Functional/Schema/PostgreSQLSchemaManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down
2 changes: 0 additions & 2 deletions tests/Functional/Schema/SchemaManagerFunctionalTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ protected function tearDown(): void
$this->connection->executeStatement('DROP SCHEMA testschema');
} catch (Exception $e) {
}

$this->markConnectionNotReusable();
}

public function testDropAndCreateSequence(): void
Expand Down

0 comments on commit 06f5925

Please sign in to comment.