Make WordPress Core

Changeset 56222


Ignore:
Timestamp:
07/12/2023 08:59:37 PM (15 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use single quotes for a string in Tests_Comment.

This resolves a WPCS error:

Error: String "1" does not require double quotes; use single quotes instead.

Includes updating a few related comments for clarity.

Follow-up to [56221].

See #57855.

File:
1 edited

Legend:

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

    r56221 r56222  
    6161
    6262        $comment = get_comment( $comments[0] );
    63         // The factory returns ints, but get_comment returns strings
     63        /*
     64         * ::create_post_comments() returns comment IDs as integers,
     65         * but WP_Comment::$comment_parent is a string.
     66         */
    6467        $this->assertSame( (string) $comments[1], $comment->comment_parent );
    6568
     
    8083
    8184        $comment = get_comment( $comments[0] );
    82         // The factory returns ints, but get_comment returns strings
     85        // WP_Post::$ID is an integer, but WP_Comment::$comment_post_ID is a string.
    8386        $this->assertSame( (string) $post2->ID, $comment->comment_post_ID );
    8487    }
     
    224227
    225228        $comment = get_comment( $comment_id );
    226         $this->assertSame( "1", $comment->user_id );
     229        $this->assertSame( '1', $comment->user_id );
    227230    }
    228231
Note: See TracChangeset for help on using the changeset viewer.