Skip to content

Commit

Permalink
Ensure the timezone use is guarded by a test.
Browse files Browse the repository at this point in the history
  • Loading branch information
frankdejonge committed Jun 8, 2022
1 parent 5938c88 commit dbde06a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Fixtures/ClassWithFormattedDateTimeInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
final class ClassWithFormattedDateTimeInput
{
public function __construct(
#[CastToDateTimeImmutable('!d-m-Y')]
#[CastToDateTimeImmutable('!d-m-Y', 'Europe/Amsterdam')]
public DateTimeImmutable $date
) {
}
Expand Down
1 change: 1 addition & 0 deletions src/ObjectHydrationTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

/**
Expand Down

0 comments on commit dbde06a

Please sign in to comment.