From 3b4b754f2ad3eee2006b9c14db559549fded47f0 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 11 Aug 2018 13:28:26 +0000 Subject: [PATCH] Tests: Avoid a race condition in `test_date_i18n_handles_shorthand_formats()` by using a delta for comparing timestamps. See #20973, #38381. git-svn-id: https://develop.svn.wordpress.org/trunk@43562 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/date/dateI18n.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/tests/date/dateI18n.php b/tests/phpunit/tests/date/dateI18n.php index c3dc1a6e77..3ffcc54a49 100644 --- a/tests/phpunit/tests/date/dateI18n.php +++ b/tests/phpunit/tests/date/dateI18n.php @@ -89,7 +89,7 @@ class Tests_Date_I18n extends WP_UnitTestCase { * @ticket 20973 */ public function test_date_i18n_handles_shorthand_formats( $short, $full ) { - $this->assertEquals( date_i18n( $full ), date_i18n( $short ) ); + $this->assertEquals( strtotime( date_i18n( $full ) ), strtotime( date_i18n( $short ) ), 'The dates should be equal', 2 ); $this->assertEquals( $short, date_i18n( '\\' . $short ) ); }