From 7f6ab7eed2989ba3c2fcfa344bafcfd6ca4dd964 Mon Sep 17 00:00:00 2001 From: rishishah-multidots Date: Wed, 11 Sep 2024 19:11:16 +0530 Subject: [PATCH 1/2] resolve phpcs error in unit test file --- lib/compat/wordpress-6.7/rest-api.php | 6 ++---- phpunit/class-block-comment-filter-test.php | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/compat/wordpress-6.7/rest-api.php b/lib/compat/wordpress-6.7/rest-api.php index 2cfe0dd6838481..43e47e6eca35db 100644 --- a/lib/compat/wordpress-6.7/rest-api.php +++ b/lib/compat/wordpress-6.7/rest-api.php @@ -149,10 +149,8 @@ function update_comment_type_in_rest_api_6_7( $prepared_comment, $request ) { */ if ( ! function_exists( 'update_get_avatar_comment_type' ) && gutenberg_is_experiment_enabled( 'gutenberg-block-comment' ) ) { function update_get_avatar_comment_type( $comment_type ) { - $comment_type[] = 'block_comment'; - return $comment_type; - + return $comment_type; } add_filter( 'get_avatar_comment_types', 'update_get_avatar_comment_type', 10, 1 ); } @@ -169,7 +167,7 @@ function update_get_avatar_comment_type( $comment_type ) { if ( ! function_exists( 'update_comment_type_filter_dropdown' ) && gutenberg_is_experiment_enabled( 'gutenberg-block-comment' ) ) { function update_comment_type_filter_dropdown() { return array( - 'comment' => __( 'Comments' ), + 'comment' => __( 'Comments' ), 'block_comment' => __( 'Block Comments' ), ); } diff --git a/phpunit/class-block-comment-filter-test.php b/phpunit/class-block-comment-filter-test.php index 45c4e5c3c4b49b..0139f533a3308b 100644 --- a/phpunit/class-block-comment-filter-test.php +++ b/phpunit/class-block-comment-filter-test.php @@ -42,7 +42,7 @@ public function test_update_get_avatar_comment_type() { // Assertions $this->assertContains( 'block_comment', $updated_comment_types ); - } + } /** * Tests that `update_comment_type_filter_dropdown` returns the correct options. From ed7fce1f70b443586d05cb338b48f0474f9a7edb Mon Sep 17 00:00:00 2001 From: rishishah-multidots Date: Wed, 11 Sep 2024 19:14:54 +0530 Subject: [PATCH 2/2] resolve phpcs error in unit test file --- lib/compat/wordpress-6.7/rest-api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compat/wordpress-6.7/rest-api.php b/lib/compat/wordpress-6.7/rest-api.php index 43e47e6eca35db..0afbe2a44dbff5 100644 --- a/lib/compat/wordpress-6.7/rest-api.php +++ b/lib/compat/wordpress-6.7/rest-api.php @@ -150,7 +150,7 @@ function update_comment_type_in_rest_api_6_7( $prepared_comment, $request ) { if ( ! function_exists( 'update_get_avatar_comment_type' ) && gutenberg_is_experiment_enabled( 'gutenberg-block-comment' ) ) { function update_get_avatar_comment_type( $comment_type ) { $comment_type[] = 'block_comment'; - return $comment_type; + return $comment_type; } add_filter( 'get_avatar_comment_types', 'update_get_avatar_comment_type', 10, 1 ); }