Skip to content

Commit

Permalink
fixup! Fix to wrong time when a DateTime with a specific timezone is …
Browse files Browse the repository at this point in the history
…created while ClockMock is active - Add test
  • Loading branch information
asprega committed Apr 4, 2022
1 parent 5b839d9 commit 3fd4e0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/ClockMockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function test_DateTime_constructor_with_microseconds_and_specific_timezon
ClockMock::freeze(new \DateTime('2022-04-04 14:26:29.123456')); // UTC, +00:00

// Reconstruct the current date (which is now based on the one mocked above) but apply a specific timezone. The
// resulting date should have its time modified accordingly to the timWezone.
// resulting date should have its time modified accordingly to the timezone.
$nowWithIndiaTimezone = new \DateTime('now', $indiaTimezone = new \DateTimeZone('+05:30'));

$this->assertEquals($indiaTimezone, $nowWithIndiaTimezone->getTimezone());
Expand Down

0 comments on commit 3fd4e0e

Please sign in to comment.