WordPress.org

Make WordPress Core

Changeset 49051


Ignore:
Timestamp:
09/26/2020 03:12:21 AM (10 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-comments-controller.php

    r48939 r49051  
    32453245        $this->assertSame( mysql_to_rfc3339( $comment->comment_date_gmt ), $data['date_gmt'] );
    32463246        $this->assertSame( get_comment_link( $comment ), $data['link'] );
    3247         $this->assertContains( 'author_avatar_urls', $data );
     3247        $this->assertArrayHasKey( 'author_avatar_urls', $data );
    32483248        $this->assertSameSets(
    32493249            array(
Note: See TracChangeset for help on using the changeset viewer.