diff --git a/tests/Tests/OrmTestCase.php b/tests/Tests/OrmTestCase.php index 057dca51e4b..7519bb8508d 100644 --- a/tests/Tests/OrmTestCase.php +++ b/tests/Tests/OrmTestCase.php @@ -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'])