Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When the site's timezone is not UTC, the "Timezone & Granularity' test fails. The following scenario happens:
For the test when tz_handling = 'utc':
Current situation:
The time is entered as "10:30", because we're in utc handling, this is interpreted correctly as a UTC time. When displaying, the time is displayed in the site's timezone, which is not the time expected by the test.
Proposed solution:
Explicitly set a 'site timezone' when starting the test, and change the test check the date being displayed in this timezone.
Comment | File | Size | Author |
---|---|---|---|
#2 | 2775223-fix-site-timezone-2.patch | 2.87 KB | Stevel |
Comments
Comment #2
Stevel CreditAttribution: Stevel commentedLet's try this. I used some inspiration from #2498619: Unit tests should use a default timezone other that UTC.
Comment #3
DamienMcKennaIs this related to #998076: Problem with timezone handling (caused by date_get_timezone_db returning only UTC)?
Comment #4
DamienMcKennaWhy not merge this back into #2646646: Tests are broken on current 7.x-2.x branch so all tests are fixed in one go?
Comment #5
DamienMcKennaLets just merge back into #2646646: Tests are broken on current 7.x-2.x branch, we don't need to split this up.