From b82c472f2481368de27ab4fcd4a2b345deb00083 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 6 Jul 2020 09:49:07 +0000 Subject: [PATCH] Tests: Correct hardcoded "3 months ago" assertion in `tests/rest-api/rest-block-directory-controller.php`. Now that more than 3 months have passed since 2020-03-23, this was causing test failures. Follow-up to [48242]. See #50321. git-svn-id: https://develop.svn.wordpress.org/trunk@48333 602fd350-edb4-49c9-b593-d223f7449a82 --- .../tests/rest-api/rest-block-directory-controller.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/rest-api/rest-block-directory-controller.php b/tests/phpunit/tests/rest-api/rest-block-directory-controller.php index 01db674491..cfbfff4374 100644 --- a/tests/phpunit/tests/rest-api/rest-block-directory-controller.php +++ b/tests/phpunit/tests/rest-api/rest-block-directory-controller.php @@ -168,8 +168,8 @@ class WP_REST_Block_Directory_Controller_Test extends WP_Test_REST_Controller_Te 'https://ps.w.org/guidepost/tags/1.2.1/build/guidepost-style.css?v=1584940380', 'https://ps.w.org/guidepost/tags/1.2.1/build/guidepost-theme.js?v=1584940380', ), - 'last_updated' => '2020-03-23T05:13:00', - 'humanized_updated' => '3 months ago', + 'last_updated' => gmdate( 'Y-m-d\TH:i:s', strtotime( $plugin['last_updated'] ) ), + 'humanized_updated' => sprintf( '%s ago', human_time_diff( strtotime( $plugin['last_updated'] ) ) ), ); $this->assertEquals( $expected, $response->get_data() );