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.
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
Comment | File | Size | Author |
---|---|---|---|
#2 | 2889803-02.patch | 2.41 KB | mpdonadio |
Comments
Comment #2
mpdonadioSince JSTB extends BTB, I think this should be OK. Don't think checking WTB is worth it?.
Comment #3
LendudeSince 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*
Comment #4
Wim Leers👍
This helps ensure basic assumptions are correct.
Comment #7
catchCommitted/pushed to 8.4.x and cherry-picked to 8.3.x. Thanks!