Skip to content

Commit

Permalink
Variable instantiation of SchemaDiff
Browse files Browse the repository at this point in the history
  • Loading branch information
wmouwen committed Mar 18, 2024
1 parent 2cd0397 commit f1a6a6a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/Tests/OrmTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,15 @@ private function createConnectionMock(AbstractPlatform $platform): Connection

private function createPlatformMock(): AbstractPlatform
{
$schemaDiff = method_exists(SchemaDiff::class, 'toSaveSql')
? new SchemaDiff() // DBAL v3
: new SchemaDiff([], [], [], [], [], [], [], []); // DBAL v4

$schemaManager = $this->createMock(AbstractSchemaManager::class);
$schemaManager->method('createSchemaConfig')
->willReturn(new SchemaConfig());
$schemaManager->method('createComparator')
->willReturn($this->mockComparator(new SchemaDiff()));
->willReturn($this->mockComparator($schemaDiff));

$platform = $this->getMockBuilder(AbstractPlatform::class)
->onlyMethods(['supportsIdentityColumns', 'createSchemaManager'])
Expand Down

0 comments on commit f1a6a6a

Please sign in to comment.