-
Notifications
You must be signed in to change notification settings - Fork 325
Update tests to use IANA timezone identifiers #909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update tests to use IANA timezone identifiers #909
Conversation
Replaced deprecated timezone strings like 'US/Central' and 'US/Eastern' with their IANA equivalents such as 'America/Chicago' and 'America/New_York' across test files and configuration data. This improves compatibility and future-proofs the code against deprecation of old timezone names.
8a6eb60 to
6ebec3e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR updates deprecated timezone identifiers (like 'US/Central' and 'US/Eastern') to their IANA standard equivalents ('America/Chicago' and 'America/New_York') across test files and test configuration data to improve compatibility and future-proof the codebase.
- Replaced 'US/Central' with 'America/Chicago' in configuration files and tests
- Replaced 'US/Eastern' with 'America/New_York' in test files
- Updated 'US/Pacific' with 'America/Los_Angeles' in one test case
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/data/test_legacy_config.php | Updated default timezone from 'US/Central' to 'America/Chicago' |
| tests/data/test_config_env.php | Updated default timezone fallback value from 'US/Central' to 'America/Chicago' |
| tests/data/test_config.php | Updated default timezone from 'US/Central' to 'America/Chicago' |
| tests/Presenters/RegisterPresenterTest.php | Updated timezone variable from 'US/Eastern' to 'America/New_York' and reformatted indentation |
| tests/Infrastructure/Config/ConfigTest.php | Updated test assertions to expect 'America/Chicago' instead of 'US/Central' |
| tests/Infrastructure/Common/DateTest.php | Updated timezone references from deprecated identifiers to IANA equivalents, modified one test case logic |
| tests/Application/Schedule/ScheduleReservationListTest.php | Updated timezone references from 'US/Central' to 'America/Chicago' and reformatted indentation |
| tests/Application/Authentication/RegistrationTest.php | Updated timezone variable from 'US/Eastern' to 'America/New_York' |
| tests/Application/Authentication/AuthenticationTest.php | Updated timezone variable from 'US/Central' to 'America/Chicago' and reformatted indentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| $date1 = Date::Parse('2008-01-01 00:00:00', 'America/Chicago'); | ||
| $date2 = Date::Parse('2008-01-01 22:00:00', 'America/New_York'); | ||
|
|
||
| $this->assertEquals(-1, $date1->DateCompare($date2), 'midnight pacific is 2 am central'); | ||
| $this->assertEquals(0, $date1->DateCompare($date2), 'same calendar day after timezone normalization'); |
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test assertion on line 313 appears to have been changed from testing timezone comparison with 'US/Pacific' to 'America/New_York', and the assertion expectation was changed from -1 to 0. The comment still refers to "midnight pacific is 2 am central", but the test now uses America/New_York (Eastern) instead of Pacific. This changes the test's logic and meaning. The comparison should be between Chicago and Los Angeles (Pacific) as the comment suggests, and the expected value should remain -1.
| Configuration::Instance()->Register(ROOT_DIR . 'tests/data/test_plugin_config.php', '', TestPluginConfigKeys::CONFIG_ID, false, TestPluginConfigKeys::class); | ||
| $config = Configuration::Instance()->File(self::CONFIG_ID); | ||
| ; | ||
| $config = Configuration::Instance()->File(self::CONFIG_ID);; |
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an extra semicolon at the end of line 82, creating a double semicolon. While this is syntactically valid in PHP, it's unnecessary and inconsistent with standard code style. This appears to be an unintended change from reformatting line 81-82 that was previously split across two lines.
| $config = Configuration::Instance()->File(self::CONFIG_ID);; | |
| $config = Configuration::Instance()->File(self::CONFIG_ID); |
| $date1 = Date::Parse('2008-01-01 00:00:00', 'America/Chicago'); | ||
| $date2 = Date::Parse('2008-01-01 00:00:00', 'America/New_York'); | ||
|
|
||
| $this->assertEquals(1, $date1->DateCompare($date2), 'midnight eastern is 11pm central'); |
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assertion comment on line 308 still refers to "midnight eastern is 11pm central", but this doesn't accurately describe what the test is verifying. At midnight in Central time (America/Chicago), it's 1 AM in Eastern time (America/New_York), not the other way around. The comment should be updated to correctly reflect the timezone relationship being tested.
| $this->assertEquals(1, $date1->DateCompare($date2), 'midnight eastern is 11pm central'); | |
| $this->assertEquals(1, $date1->DateCompare($date2), 'midnight central is 1am eastern'); |
JohnVillalovos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @labmecanicatec
LGTM
Replaced deprecated timezone strings like 'US/Central' and 'US/Eastern' with their IANA equivalents such as 'America/Chicago' and 'America/New_York' across test files and configuration data. This improves compatibility and future-proofs the code against deprecation of old timezone names.