From 85ef2a31d4e4afaa1e7240d1d8639c0ec351c0be Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 16 May 2025 11:31:49 +0200 Subject: [PATCH] add test for DatePointType converting database string to PHP value --- .../Bridge/Doctrine/Tests/Types/DatePointTypeTest.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Symfony/Bridge/Doctrine/Tests/Types/DatePointTypeTest.php b/src/Symfony/Bridge/Doctrine/Tests/Types/DatePointTypeTest.php index 6900de3f168b9..84b265ed6502c 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Types/DatePointTypeTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Types/DatePointTypeTest.php @@ -76,6 +76,14 @@ public function testDateTimeImmutableConvertsToPHPValue() $this->assertSame($expected->format($format), $actual->format($format)); } + public function testDatabaseValueConvertsToPHPValue() + { + $actual = $this->type->convertToPHPValue('2025-03-03 12:13:14', new PostgreSQLPlatform()); + + $this->assertInstanceOf(DatePoint::class, $actual); + $this->assertSame('2025-03-03 12:13:14', $actual->format('Y-m-d H:i:s')); + } + public function testGetName() { $this->assertSame('date_point', $this->type->getName());