From 0e9c555840ea8708238176ff47728ede309643e6 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 8 Dec 2022 15:07:45 +0000 Subject: [PATCH] Tests: Use more descriptive name for a `wp_new_comment()` test. Includes: * Correcting the order of expected and actual values. * Adding a missing `@covers` tag for another test next to it. Follow-up to [32299], [53863], [54489]. See #56793. git-svn-id: https://develop.svn.wordpress.org/trunk@54949 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/comment.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/comment.php b/tests/phpunit/tests/comment.php index e75d2fd499..3914a94081 100644 --- a/tests/phpunit/tests/comment.php +++ b/tests/phpunit/tests/comment.php @@ -523,7 +523,7 @@ class Tests_Comment extends WP_UnitTestCase { /** * @covers ::wp_new_comment */ - public function test_comment_field_lengths() { + public function test_wp_new_comment_respects_comment_field_lengths() { $data = array( 'comment_post_ID' => self::$post_id, 'comment_author' => 'Comment Author', @@ -539,11 +539,13 @@ class Tests_Comment extends WP_UnitTestCase { $comment = get_comment( $id ); - $this->assertSame( strlen( $comment->comment_content ), 65535 ); + $this->assertSame( 65535, strlen( $comment->comment_content ) ); } /** * @ticket 56244 + * + * @covers ::wp_new_comment */ public function test_wp_new_comment_sends_all_expected_parameters_to_preprocess_comment_filter() { $user = get_userdata( self::$user_id );