Make WordPress Core


Ignore:
Timestamp:
03/06/2023 03:01:33 PM (23 months ago)
Author:
hellofromTonya
Message:

Build/Test Tooling: Use assertSame() in Tests_Comment::test_update_comment_from_privileged_user_by_privileged_user().

Change from assertEquals() to assertSame(). Why? To ensure both the return value and data type match the expected results.

Follow-up to [c].

Props costdev, peterwilsoncc, mukesh27, ankitmaru.
See #56800.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/comment.php

    r55369 r55466  
    162162
    163163        $comment = get_comment( $comment_id );
    164         $this->assertEquals( '<a href="http://example.localhost/something.html" rel="nofollow ugc">click</a>', $comment->comment_content, 'Comment: ' . $comment->comment_content );
     164        $this->assertSame( '<a href="http://example.localhost/something.html" rel="nofollow ugc">click</a>', $comment->comment_content, 'Comment: ' . $comment->comment_content );
    165165        wp_set_current_user( 0 );
    166166    }
Note: See TracChangeset for help on using the changeset viewer.