Make WordPress Core


Ignore:
Timestamp:
10/14/2022 07:00:08 AM (3 years ago)
Author:
peterwilsoncc
Message:

Tests: Replace the timezone used in date/time tests.

The Europe/Kiev timezone has been deprecated in PHP 8.2 and replaced with Europe/Kyiv.

The tests updated in this commit are testing the WordPress date/time functionality. They are not testing whether WP or PHP can handle deprecated timezone names correctly.

To ensure the tests follow the original purpose, the use of Europe/Kiev within these tests is now replaced with the Europe/Helsinki timezone, which is within the same timezone as Europe/Kyiv. This should ensure that these tests run without issue and test what they are supposed to be testing on every supported PHP version (unless at some point in the future Europe/Helsinki would be renamed, but that's a bridge to cross if and when).

Note: Separate tests should/will be added to ensure that relevant date/time related functions handle a deprecated timezone correctly, but that is not something these tests are supposed to be testing.

Follow-up to [45853], [45856], [45876], [45882], [45887], [45908], [45914], [46577], [46154], [46580], [46864], [46974], [54207].

Props jrf, costdev, SergeyBiryukov.
Merges [54217] to the 5.6 branch.
See #56468.

Location:
branches/5.6
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.6

  • branches/5.6/tests/phpunit/tests/date/dateI18n.php

    r48952 r54516  
    1111     */
    1212    public function test_should_return_current_time_on_invalid_timestamp() {
    13         $timezone = 'Europe/Kiev';
     13        $timezone = 'Europe/Helsinki';
    1414        update_option( 'timezone_string', $timezone );
    1515
     
    2424     */
    2525    public function test_should_handle_zero_timestamp() {
    26         $timezone = 'Europe/Kiev';
     26        $timezone = 'Europe/Helsinki';
    2727        update_option( 'timezone_string', $timezone );
    2828
     
    143143     */
    144144    public function test_should_return_wp_timestamp() {
    145         update_option( 'timezone_string', 'Europe/Kiev' );
     145        update_option( 'timezone_string', 'Europe/Helsinki' );
    146146
    147147        $datetime     = new DateTimeImmutable( 'now', wp_timezone() );
     
    193193    public function dst_times() {
    194194        return array(
    195             'Before DST start' => array( '2019-03-31 02:59:00', 'Europe/Kiev' ),
    196             'After DST start'  => array( '2019-03-31 04:01:00', 'Europe/Kiev' ),
    197             'Before DST end'   => array( '2019-10-27 02:59:00', 'Europe/Kiev' ),
    198             'After DST end'    => array( '2019-10-27 04:01:00', 'Europe/Kiev' ),
     195            'Before DST start' => array( '2019-03-31 02:59:00', 'Europe/Helsinki' ),
     196            'After DST start'  => array( '2019-03-31 04:01:00', 'Europe/Helsinki' ),
     197            'Before DST end'   => array( '2019-10-27 02:59:00', 'Europe/Helsinki' ),
     198            'After DST end'    => array( '2019-10-27 04:01:00', 'Europe/Helsinki' ),
    199199        );
    200200    }
Note: See TracChangeset for help on using the changeset viewer.