Skip to content

Commit

Permalink
Fix unit test error when local timezone is different than UTC (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gared committed Mar 17, 2021
1 parent 6e91997 commit 35d371b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/Integration/EventsGeneratorTest.php
Expand Up @@ -13,6 +13,7 @@

use DateInterval;
use DateTimeImmutable;
use DateTimeZone;
use Eluceo\iCal\Domain\Entity\Calendar;
use Eluceo\iCal\Domain\Entity\Event;
use Eluceo\iCal\Domain\ValueObject\Date;
Expand All @@ -28,7 +29,7 @@ class EventsGeneratorTest extends TestCase
public function testEventsGeneratorCreatesIcsContent(): void
{
$generator = function (): Generator {
$day = new DateTimeImmutable('2020-01-01 15:00:00');
$day = new DateTimeImmutable('2020-01-01 15:00:00', new DateTimeZone('UTC'));
$timestamp = new Timestamp($day);
$dayInterval = new DateInterval('P1D');
for ($i = 0; $i < 3; ++$i) {
Expand Down

0 comments on commit 35d371b

Please sign in to comment.