From cdf3ac093de45c2c2d67fe0635f3d8a513a97895 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 12 Jul 2023 20:59:37 +0000 Subject: [PATCH] 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 --- tests/phpunit/tests/comment.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/phpunit/tests/comment.php b/tests/phpunit/tests/comment.php index 98fbbbbc41..e3c6397b69 100644 --- a/tests/phpunit/tests/comment.php +++ b/tests/phpunit/tests/comment.php @@ -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 ); } /**