Problem/Motivation

In most of the date/time/timezone testing in core, we assume that the PHP environment and default time zone has been set. We do this in the phpunit bootstrap and other test base setups, but we don't have explicit test coverage to catch someone changing this and getting fails in tests that are calibrated to 'Australia/Sydney'.

Proposed resolution

Add assertions that date_default_timezone_get() is 'Australia/Sydney' in the various test base tests w/ comment. This will make a inadvertant test failure easier to pinpoint.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#2 2889803-02.patch2.41 KBmpdonadio

Comments

mpdonadio created an issue. See original summary.

mpdonadio’s picture

Version: 8.3.x-dev » 8.4.x-dev
Assigned: mpdonadio » Unassigned
Status: Active » Needs review
StatusFileSize
new2.41 KB

Since JSTB extends BTB, I think this should be OK. Don't think checking WTB is worth it?.

lendude’s picture

Version: 8.4.x-dev » 8.3.x-dev
Status: Needs review » Reviewed & tested by the community

Since this is something the test suite depends on being set correctly, it makes a lot of sense to test for it.

Since it's a test coverage only patch this should be eligible for 8.3.x

And I agree that WebTestBase can live without it. But if it's as simple as just adding the same test method to WebTestBaseTest, then it might be nice to keep them in sync for now. *shrug*

wim leers’s picture

👍

This helps ensure basic assumptions are correct.

  • catch committed d8693fe on 8.4.x
    Issue #2889803 by mpdonadio: Add test coverage for default time zone in...

  • catch committed 01b97ea on 8.3.x
    Issue #2889803 by mpdonadio: Add test coverage for default time zone in...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.4.x and cherry-picked to 8.3.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.