#63079 closed defect (bug) (fixed)
Phpunit test failure due to US daylight saving time
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.8 | Priority: | normal |
Severity: | normal | Version: | trunk |
Component: | Date/Time | Keywords: | has-patch has-unit-tests commit |
Focuses: | Cc: |
Description
The test_wp_timezone_override_offset
phpunit test is currently failing due to US daylight saving time.
Change History (11)
This ticket was mentioned in PR #8479 on WordPress/wordpress-develop by @debarghyabanerjee.
6 weeks ago
#4
- Keywords has-patch has-unit-tests added; needs-patch removed
Trac Ticke: Core-63079
### Summary
- This PR fixes the failing test for
wp_timezone_override_offset()
, caused byDaylight Saving Time (DST)
adjustments inAmerica/St_Johns
. The test previously expected a static-3.5
offset, but during DST, the actual offset is-2.5
, leading to failures.
### Changes
- Introduced
get_expected_offset()
to dynamically determine the correct offset.
- Updated the test data provider to use this function instead of a hardcoded value.
@audrasjb commented on PR #8479:
6 weeks ago
#5
I think a better approach would be something along the lines of: if the
America/St_Johns
timezone is currently observing DST then the expected value is-2.5
, else the expected value is-3.5
. What do you think?
Yes, nice idea, sounds good to me 👍
@debarghyabanerjee commented on PR #8479:
6 weeks ago
#6
Hi @johnbillion , It makes sense, thanks for the review and feedback. I have updated the implementation, can you please check once. Assigning your for re-review.
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
6 weeks ago
#9
@
6 weeks ago
- Owner set to johnbillion
- Resolution set to fixed
- Status changed from new to closed
In 59959:
@johnbillion commented on PR #8479:
6 weeks ago
#10
This was committed in https://core.trac.wordpress.org/changeset/59959 . Thanks everyone!
@johnbillion commented on PR #8479:
6 weeks ago
#11
This was committed in https://core.trac.wordpress.org/changeset/59959 . Thanks everyone!
Test failure:
Tests_Functions_wpTimezoneOverrideOffset::test_wp_timezone_override_offset with data set "NST option set" ('America/St_Johns', -3.5)
Failed asserting that -2.5 is identical to -3.5.