From 4f77abf6b980ce0932710395a3aca3dac3adee62 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 26 Sep 2019 01:39:19 +0000 Subject: [PATCH] REST API: Use delta comparison for floating date test added in [46279] to avoid race conditions. See #48113. git-svn-id: https://develop.svn.wordpress.org/trunk@46318 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/tests/post.php b/tests/phpunit/tests/post.php index 241536facf..39a8bae14a 100644 --- a/tests/phpunit/tests/post.php +++ b/tests/phpunit/tests/post.php @@ -1428,6 +1428,6 @@ class Tests_Post extends WP_UnitTestCase { ); $post = get_post( $post_id ); - self::assertEquals( gmdate( 'Y-m-d H:i:s' ), $post->post_date_gmt ); + self::assertEquals( strtotime( gmdate( 'Y-m-d H:i:s' ) ), strtotime( $post->post_date_gmt ), 'The dates should be equal', 2 ); } }