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.

git-svn-id: https://develop.svn.wordpress.org/trunk@56222 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2023-07-12 20:59:37 +00:00
parent 434dd6be91
commit cdf3ac093d

View File

@ -60,7 +60,10 @@ class Tests_Comment extends WP_UnitTestCase {
$this->assertSame( 1, $result );
$comment = get_comment( $comments[0] );
// The factory returns ints, but get_comment returns strings
/*
* ::create_post_comments() returns comment IDs as integers,
* but WP_Comment::$comment_parent is a string.
*/
$this->assertSame( (string) $comments[1], $comment->comment_parent );
$result = wp_update_comment(
@ -79,7 +82,7 @@ class Tests_Comment extends WP_UnitTestCase {
);
$comment = get_comment( $comments[0] );
// The factory returns ints, but get_comment returns strings
// WP_Post::$ID is an integer, but WP_Comment::$comment_post_ID is a string.
$this->assertSame( (string) $post2->ID, $comment->comment_post_ID );
}
@ -223,7 +226,7 @@ class Tests_Comment extends WP_UnitTestCase {
);
$comment = get_comment( $comment_id );
$this->assertSame( "1", $comment->user_id );
$this->assertSame( '1', $comment->user_id );
}
/**