diff --git a/tests/ConnectionTest.php b/tests/ConnectionTest.php index 0ffb7d92cb1..d8bfd8f722d 100644 --- a/tests/ConnectionTest.php +++ b/tests/ConnectionTest.php @@ -745,7 +745,7 @@ public function testPlatformDetectionFetchedFromParameters(): void $driverConnectionMock = $this->createMock(ServerInfoAwareConnection::class); - $platformMock = $this->getMockForAbstractClass(AbstractPlatform::class); + $platformMock = $this->createMock(AbstractPlatform::class); $connection = new Connection(['serverVersion' => '8.0'], $driverMock); @@ -767,7 +767,7 @@ public function testPlatformDetectionFetchedFromPrimaryReplicaParameters(): void $driverConnectionMock = $this->createMock(ServerInfoAwareConnection::class); - $platformMock = $this->getMockForAbstractClass(AbstractPlatform::class); + $platformMock = $this->createMock(AbstractPlatform::class); $connection = new Connection(['primary' => ['serverVersion' => '8.0']], $driverMock); diff --git a/tests/Functional/Ticket/DBAL461Test.php b/tests/Functional/Ticket/DBAL461Test.php index 817d6da1bb3..5513fadf593 100644 --- a/tests/Functional/Ticket/DBAL461Test.php +++ b/tests/Functional/Ticket/DBAL461Test.php @@ -15,7 +15,7 @@ class DBAL461Test extends TestCase public function testIssue(): void { $conn = $this->createMock(Connection::class); - $platform = $this->getMockForAbstractClass(SQLServer2012Platform::class); + $platform = new SQLServer2012Platform(); $platform->registerDoctrineTypeMapping('numeric', Types::DECIMAL); $schemaManager = new SQLServerSchemaManager($conn, $platform); diff --git a/tests/Types/BaseDateTypeTestCase.php b/tests/Types/BaseDateTypeTestCase.php index 00fb2a72f36..34eb7bb219d 100644 --- a/tests/Types/BaseDateTypeTestCase.php +++ b/tests/Types/BaseDateTypeTestCase.php @@ -24,7 +24,7 @@ abstract class BaseDateTypeTestCase extends TestCase protected function setUp(): void { - $this->platform = $this->getMockForAbstractClass(AbstractPlatform::class); + $this->platform = $this->createMock(AbstractPlatform::class); $this->currentTimezone = date_default_timezone_get(); self::assertInstanceOf(Type::class, $this->type); diff --git a/tests/Types/DateTest.php b/tests/Types/DateTest.php index ad9a1942953..1f4bfd320f5 100644 --- a/tests/Types/DateTest.php +++ b/tests/Types/DateTest.php @@ -15,6 +15,9 @@ protected function setUp(): void $this->type = new DateType(); parent::setUp(); + + $this->platform->method('getDateFormatString') + ->willReturn('Y-m-d'); } public function testDateConvertsToPHPValue(): void diff --git a/tests/Types/DateTimeTest.php b/tests/Types/DateTimeTest.php index 3198daa947c..405fed64a58 100644 --- a/tests/Types/DateTimeTest.php +++ b/tests/Types/DateTimeTest.php @@ -13,13 +13,16 @@ protected function setUp(): void $this->type = new DateTimeType(); parent::setUp(); + + $this->platform->method('getDateTimeFormatString') + ->willReturn('Y-m-d H:i:s'); } public function testDateTimeConvertsToDatabaseValue(): void { $date = new DateTime('1985-09-01 10:10:10'); - $expected = $date->format($this->platform->getDateTimeTzFormatString()); + $expected = $date->format($this->platform->getDateTimeFormatString()); $actual = $this->type->convertToDatabaseValue($date, $this->platform); self::assertEquals($expected, $actual); diff --git a/tests/Types/DateTimeTzTest.php b/tests/Types/DateTimeTzTest.php index 04c386edc5d..0c84e3174a3 100644 --- a/tests/Types/DateTimeTzTest.php +++ b/tests/Types/DateTimeTzTest.php @@ -13,6 +13,9 @@ protected function setUp(): void $this->type = new DateTimeTzType(); parent::setUp(); + + $this->platform->method('getDateTimeTzFormatString') + ->willReturn('Y-m-d H:i:s'); } public function testDateTimeConvertsToDatabaseValue(): void diff --git a/tests/Types/TimeTest.php b/tests/Types/TimeTest.php index 2fe2e5a8a34..9286473726f 100644 --- a/tests/Types/TimeTest.php +++ b/tests/Types/TimeTest.php @@ -13,6 +13,9 @@ protected function setUp(): void $this->type = new TimeType(); parent::setUp(); + + $this->platform->method('getTimeFormatString') + ->willReturn('H:i:s'); } public function testTimeConvertsToPHPValue(): void diff --git a/tests/Types/VarDateTimeTest.php b/tests/Types/VarDateTimeTest.php index 513bf0b24e8..de2e665f332 100644 --- a/tests/Types/VarDateTimeTest.php +++ b/tests/Types/VarDateTimeTest.php @@ -18,15 +18,18 @@ class VarDateTimeTest extends TestCase protected function setUp(): void { - $this->platform = $this->getMockForAbstractClass(AbstractPlatform::class); + $this->platform = $this->createMock(AbstractPlatform::class); $this->type = new VarDateTimeType(); + + $this->platform->method('getDateTimeFormatString') + ->willReturn('Y-m-d H:i:s'); } public function testDateTimeConvertsToDatabaseValue(): void { $date = new DateTime('1985-09-01 10:10:10'); - $expected = $date->format($this->platform->getDateTimeTzFormatString()); + $expected = $date->format($this->platform->getDateTimeFormatString()); $actual = $this->type->convertToDatabaseValue($date, $this->platform); self::assertEquals($expected, $actual);