Make WordPress Core


Ignore:
Timestamp:
04/28/2024 06:55:25 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Tests: Use assertSame() in wp_handle_comment_submission() tests.

This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using assertSame() should generally be preferred to assertEquals() where appropriate, to make the tests more reliable.

Follow-up to [38778], [46829].

Props costdev.
See #60706.

File:
1 edited

Legend:

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

    r56548 r58052  
    855855
    856856                $this->assertNotWPError( $second_comment );
    857                 $this->assertEquals( self::$post->ID, $second_comment->comment_post_ID );
     857                $this->assertSame( (string) self::$post->ID, $second_comment->comment_post_ID );
    858858        }
    859859
Note: See TracChangeset for help on using the changeset viewer.