From e2b74bee8264054d4bcde7e00cf1763e0b31cb29 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 26 Sep 2020 03:12:21 +0000 Subject: [PATCH] Tests: Correct assertion in `WP_Test_REST_Comments_Controller::check_comment_data()`. `author_avatar_urls` should be present in the comment data array keys, not values. The test only passed accidentally due to `assertContains()` not performing a strict type check. See #38266, #50913. git-svn-id: https://develop.svn.wordpress.org/trunk@49051 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/rest-api/rest-comments-controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/tests/rest-api/rest-comments-controller.php b/tests/phpunit/tests/rest-api/rest-comments-controller.php index 9d35a747f9..ba67234a23 100644 --- a/tests/phpunit/tests/rest-api/rest-comments-controller.php +++ b/tests/phpunit/tests/rest-api/rest-comments-controller.php @@ -3244,7 +3244,7 @@ class WP_Test_REST_Comments_Controller extends WP_Test_REST_Controller_Testcase $this->assertSame( mysql_to_rfc3339( $comment->comment_date ), $data['date'] ); $this->assertSame( mysql_to_rfc3339( $comment->comment_date_gmt ), $data['date_gmt'] ); $this->assertSame( get_comment_link( $comment ), $data['link'] ); - $this->assertContains( 'author_avatar_urls', $data ); + $this->assertArrayHasKey( 'author_avatar_urls', $data ); $this->assertSameSets( array( 'self',