From 4b3e128140a6b48e5f1175cae13ec0bf8cda3133 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Tue, 8 Nov 2016 22:31:51 +0000 Subject: [PATCH] Date/Time: Improve `date_i18n()` timezone tests. This uses a timezone without DST for the tests covering `date_i18n()`. Fixes #37910. git-svn-id: https://develop.svn.wordpress.org/trunk@39167 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/date/dateI18n.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/phpunit/tests/date/dateI18n.php b/tests/phpunit/tests/date/dateI18n.php index df78152376..1e34af22c8 100644 --- a/tests/phpunit/tests/date/dateI18n.php +++ b/tests/phpunit/tests/date/dateI18n.php @@ -22,19 +22,19 @@ class Tests_Date_I18n extends WP_UnitTestCase { } public function test_custom_timezone_setting() { - update_option( 'timezone_string', 'Europe/Zurich' ); + update_option( 'timezone_string', 'America/Regina' ); $this->assertEquals( strtotime( date( 'Y-m-d H:i:s', time() + get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ), strtotime( date_i18n( 'Y-m-d H:i:s' ) ), 'The dates should be equal', 2 ); } public function test_date_should_be_in_gmt_with_custom_timezone_setting() { - update_option( 'timezone_string', 'Europe/Zurich' ); + update_option( 'timezone_string', 'America/Regina' ); $this->assertEquals( strtotime( date( 'Y-m-d H:i:s' ) ), strtotime( date_i18n( 'Y-m-d H:i:s', false, true ) ), 'The dates should be equal', 2 ); } public function test_date_should_be_in_gmt_with_custom_timezone_setting_and_timestamp() { - update_option( 'timezone_string', 'Europe/Zurich' ); + update_option( 'timezone_string', 'America/Regina' ); $this->assertEquals( '2012-12-01 00:00:00', date_i18n( 'Y-m-d H:i:s', strtotime( '2012-12-01 00:00:00' ) ) ); } @@ -63,8 +63,8 @@ class Tests_Date_I18n extends WP_UnitTestCase { } public function test_adjusts_format_based_on_timezone_string() { - update_option( 'timezone_string', 'Europe/Zurich' ); + update_option( 'timezone_string', 'America/Regina' ); - $this->assertEquals( '2012-12-01 00:00:00 CET +01:00 Europe/Zurich', date_i18n( 'Y-m-d H:i:s T P e', strtotime( '2012-12-01 00:00:00' ) ) ); + $this->assertEquals( '2012-12-01 00:00:00 CST -06:00 America/Regina', date_i18n( 'Y-m-d H:i:s T P e', strtotime( '2012-12-01 00:00:00' ) ) ); } }