Skip to content

Commit cdf3ac0

Browse files
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
1 parent 434dd6b commit cdf3ac0

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

tests/phpunit/tests/comment.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ public function test_wp_update_comment() {
6060
$this->assertSame( 1, $result );
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

6669
$result = wp_update_comment(
@@ -79,7 +82,7 @@ public function test_wp_update_comment() {
7982
);
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
}
8588

@@ -223,7 +226,7 @@ public function test_wp_update_comment_updates_user_id() {
223226
);
224227

225228
$comment = get_comment( $comment_id );
226-
$this->assertSame( "1", $comment->user_id );
229+
$this->assertSame( '1', $comment->user_id );
227230
}
228231

229232
/**

0 commit comments

Comments
 (0)