Make WordPress Core

Changeset 58803


Ignore:
Timestamp:
07/24/2024 03:08:08 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Tests: Use more specific assertions in get_comment_author() tests.

Follow-up to [58335].

See #61530.

File:
1 edited

Legend:

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

    r58756 r58803  
    2323        public function get_comment_author_filter( $comment_author, $comment_id, $comment ) {
    2424                $this->assertSame( $comment_id, self::$comment->comment_ID, 'Comment IDs do not match.' );
    25                 $this->assertTrue( is_string( $comment_id ), '$comment_id parameter is not a string.' );
     25                $this->assertIsString( $comment_id, '$comment_id parameter is not a string.' );
    2626
    2727                return $comment_author;
     
    4242        public function get_comment_author_filter_non_existent_id( $comment_author, $comment_id, $comment ) {
    4343                $this->assertSame( $comment_id, (string) self::$non_existent_comment_id, 'Comment IDs do not match.' );
    44                 $this->assertTrue( is_string( $comment_id ), '$comment_id parameter is not a string.' );
     44                $this->assertIsString( $comment_id, '$comment_id parameter is not a string.' );
    4545
    4646                return $comment_author;
     
    7272                        $comment_props->user_id = $user->ID;
    7373                }
     74
    7475                $comment = new WP_Comment( $comment_props );
     76
    7577                $this->assertSame( $expected, get_comment_author( $comment ) );
    7678        }
Note: See TracChangeset for help on using the changeset viewer.