From 9efcfbbf3f116d508401fd21c282df57286c1256 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Tue, 29 Jan 2019 01:19:30 +0000 Subject: [PATCH] Tests: Fix the tests for the `c` and `r` formats in `date_i18n()`. To test the `date_i18n()` output correctly, the tests added in [43434] need to set a non-UTC timezone. Props Rarst. Fixes #20973. git-svn-id: https://develop.svn.wordpress.org/trunk@44710 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/date/dateI18n.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/phpunit/tests/date/dateI18n.php b/tests/phpunit/tests/date/dateI18n.php index 3ffcc54a49..408a4ce447 100644 --- a/tests/phpunit/tests/date/dateI18n.php +++ b/tests/phpunit/tests/date/dateI18n.php @@ -89,6 +89,8 @@ class Tests_Date_I18n extends WP_UnitTestCase { * @ticket 20973 */ public function test_date_i18n_handles_shorthand_formats( $short, $full ) { + update_option( 'timezone_string', 'America/Regina' ); + $this->assertEquals( strtotime( date_i18n( $full ) ), strtotime( date_i18n( $short ) ), 'The dates should be equal', 2 ); $this->assertEquals( $short, date_i18n( '\\' . $short ) ); }