From f1a6a6a26a2a885724816e7f558000d03e7a77f4 Mon Sep 17 00:00:00 2001 From: Willem Mouwen Date: Mon, 18 Mar 2024 20:24:02 +0100 Subject: [PATCH] Variable instantiation of SchemaDiff --- tests/Tests/OrmTestCase.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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'])