Skip to content

Commit ac00bc9

Browse files
Remove unnecessary usages of DateTime
1 parent a9a8337 commit ac00bc9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Tests/InlineTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ public function testParseTimestampAsUnixTimestampByDefault(string $yaml, int $ye
574574
*/
575575
public function testParseTimestampAsDateTimeObject(string $yaml, int $year, int $month, int $day, int $hour, int $minute, int $second, int $microsecond, string $timezone)
576576
{
577-
$expected = (new \DateTime($yaml))
577+
$expected = (new \DateTimeImmutable($yaml))
578578
->setTimeZone(new \DateTimeZone('UTC'))
579579
->setDate($year, $month, $day)
580580
->setTime($hour, $minute, $second, $microsecond);
@@ -599,7 +599,7 @@ public static function getTimestampTests(): array
599599
*/
600600
public function testParseNestedTimestampListAsDateTimeObject(string $yaml, int $year, int $month, int $day, int $hour, int $minute, int $second, int $microsecond)
601601
{
602-
$expected = (new \DateTime($yaml))
602+
$expected = (new \DateTimeImmutable($yaml))
603603
->setTimeZone(new \DateTimeZone('UTC'))
604604
->setDate($year, $month, $day)
605605
->setTime($hour, $minute, $second, $microsecond);

0 commit comments

Comments
 (0)