diff --git a/src/Fixtures/ClassWithFormattedDateTimeInput.php b/src/Fixtures/ClassWithFormattedDateTimeInput.php index 60b0d16..28bf00a 100644 --- a/src/Fixtures/ClassWithFormattedDateTimeInput.php +++ b/src/Fixtures/ClassWithFormattedDateTimeInput.php @@ -11,7 +11,7 @@ final class ClassWithFormattedDateTimeInput { public function __construct( - #[CastToDateTimeImmutable('!d-m-Y')] + #[CastToDateTimeImmutable('!d-m-Y', 'Europe/Amsterdam')] public DateTimeImmutable $date ) { } diff --git a/src/ObjectHydrationTestCase.php b/src/ObjectHydrationTestCase.php index 40b61ba..8349ef3 100644 --- a/src/ObjectHydrationTestCase.php +++ b/src/ObjectHydrationTestCase.php @@ -227,6 +227,7 @@ public function hydrating_a_class_with_a_formatted_date(): void self::assertInstanceOf(ClassWithFormattedDateTimeInput::class, $object); self::assertEquals('1987-11-24 00:00:00', $object->date->format('Y-m-d H:i:s')); + self::assertEquals('Europe/Amsterdam', $object->date->getTimezone()->getName()); } /**