Skip to content

Conversation

@labmecanicatec
Copy link
Contributor

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.

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.
Copy link

Copilot AI left a 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.

Comment on lines +310 to +313
$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');
Copy link

Copilot AI Dec 29, 2025

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.

Copilot uses AI. Check for mistakes.
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);;
Copy link

Copilot AI Dec 29, 2025

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.

Suggested change
$config = Configuration::Instance()->File(self::CONFIG_ID);;
$config = Configuration::Instance()->File(self::CONFIG_ID);

Copilot uses AI. Check for mistakes.
$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');
Copy link

Copilot AI Dec 29, 2025

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.

Suggested change
$this->assertEquals(1, $date1->DateCompare($date2), 'midnight eastern is 11pm central');
$this->assertEquals(1, $date1->DateCompare($date2), 'midnight central is 1am eastern');

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@JohnVillalovos JohnVillalovos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @labmecanicatec

LGTM

@JohnVillalovos JohnVillalovos merged commit 8e7645b into LibreBooking:develop Dec 29, 2025
17 checks passed
@labmecanicatec labmecanicatec deleted the fix/phpunit-iana-timezones branch December 30, 2025 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants