Skip to content

Commit 830918d

Browse files
minor #60437 [DoctrineBridge] add test for DatePointType converting database string to PHP value (xabbuh)
This PR was merged into the 7.3 branch. Discussion ---------- [DoctrineBridge] add test for `DatePointType` converting database string to PHP value | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT the present tests were not covering the case were a value was being read from the database and converted to a `DatePoint` instance Commits ------- 85ef2a3 add test for DatePointType converting database string to PHP value
2 parents c0a1a3a + 85ef2a3 commit 830918d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Symfony/Bridge/Doctrine/Tests/Types/DatePointTypeTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ public function testDateTimeImmutableConvertsToPHPValue()
7676
$this->assertSame($expected->format($format), $actual->format($format));
7777
}
7878

79+
public function testDatabaseValueConvertsToPHPValue()
80+
{
81+
$actual = $this->type->convertToPHPValue('2025-03-03 12:13:14', new PostgreSQLPlatform());
82+
83+
$this->assertInstanceOf(DatePoint::class, $actual);
84+
$this->assertSame('2025-03-03 12:13:14', $actual->format('Y-m-d H:i:s'));
85+
}
86+
7987
public function testGetName()
8088
{
8189
$this->assertSame('date_point', $this->type->getName());

0 commit comments

Comments
 (0)