From 43966c4d5aef5dc0c7958d273aa3076d3170d028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 9 Nov 2023 15:50:09 +0100 Subject: [PATCH 1/2] remove the change of timezone in test's setUp --- .../Connector/MSGraph/CalendarSyncerTest.php | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/Bundle/ChillCalendarBundle/Tests/RemoteCalendar/Connector/MSGraph/CalendarSyncerTest.php b/src/Bundle/ChillCalendarBundle/Tests/RemoteCalendar/Connector/MSGraph/CalendarSyncerTest.php index 8f6cb9335..e6196aead 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/RemoteCalendar/Connector/MSGraph/CalendarSyncerTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/RemoteCalendar/Connector/MSGraph/CalendarSyncerTest.php @@ -356,20 +356,6 @@ final class CalendarSyncerTest extends TestCase } JSON; - protected function setUp(): void - { - parent::setUp(); - - // all tests should run when timezone = +02:00 - $brussels = new \DateTimeZone('Europe/Brussels'); - - if (7200 === $brussels->getOffset(new \DateTimeImmutable())) { - date_default_timezone_set('Europe/Brussels'); - } else { - date_default_timezone_set('Europe/Moscow'); - } - } - public function testHandleAttendeesConfirmingCalendar(): void { $machineHttpClient = new MockHttpClient([ From 9673b369ef7f73c22922a51348174f15fdc09006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 9 Nov 2023 16:13:58 +0100 Subject: [PATCH 2/2] DX: restore the requirements of phpunit's tests The problem with timezone is now fixed --- .gitlab-ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eb4e547fd..32b7e5221 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -108,8 +108,6 @@ rector_tests: # - tests/app/vendor/ unit_tests: - # temporarily allow failure due to problem with timezone - allow_failure: true stage: Tests image: gitea.champs-libres.be/chill-project/chill-skeleton-basic/base-image:php82 script: