Make WordPress Core


Ignore:
Timestamp:
07/12/2023 08:04:02 PM (15 months ago)
Author:
jorbin
Message:

Tests: Use assertSame() in Tests_Comment

See #57855.

File:
1 edited

Legend:

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

    r55466 r56221  
    6161
    6262        $comment = get_comment( $comments[0] );
    63         $this->assertEquals( $comments[1], $comment->comment_parent );
     63        // The factory returns ints, but get_comment returns strings
     64        $this->assertSame( (string) $comments[1], $comment->comment_parent );
    6465
    6566        $result = wp_update_comment(
     
    7980
    8081        $comment = get_comment( $comments[0] );
    81         $this->assertEquals( $post2->ID, $comment->comment_post_ID );
     82        // The factory returns ints, but get_comment returns strings
     83        $this->assertSame( (string) $post2->ID, $comment->comment_post_ID );
    8284    }
    8385
     
    222224
    223225        $comment = get_comment( $comment_id );
    224         $this->assertEquals( 1, $comment->user_id );
     226        $this->assertSame( "1", $comment->user_id );
    225227    }
    226228
Note: See TracChangeset for help on using the changeset viewer.