From ba71390b7cf156e96747e467fb2d011d0a0ac6eb Mon Sep 17 00:00:00 2001 From: rishishah-multidots Date: Wed, 11 Sep 2024 19:01:14 +0530 Subject: [PATCH] remove spacing from unit testing file --- phpunit/class-block-comment-filter-test.php | 29 ++++++++++----------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/phpunit/class-block-comment-filter-test.php b/phpunit/class-block-comment-filter-test.php index 40cc5c0b485ab..45c4e5c3c4b49 100644 --- a/phpunit/class-block-comment-filter-test.php +++ b/phpunit/class-block-comment-filter-test.php @@ -12,9 +12,9 @@ class Tests_blockCommentFilter extends WP_UnitTestCase { */ public function test_update_comment_type_in_rest_api_6_7() { // Mock request and prepared comment - $request = new WP_REST_Request(WP_REST_Server::READABLE); - $request->set_param('comment_type', 'block_comment'); - $request->set_param('comment_approved', '1'); + $request = new WP_REST_Request( WP_REST_Server::READABLE ); + $request->set_param( 'comment_type', 'block_comment' ); + $request->set_param( 'comment_approved', '1' ); $prepared_comment = array( 'comment_type' => '', @@ -22,11 +22,11 @@ public function test_update_comment_type_in_rest_api_6_7() { ); // Call the function - $updated_comment = update_comment_type_in_rest_api_6_7($prepared_comment, $request); + $updated_comment = update_comment_type_in_rest_api_6_7( $prepared_comment, $request ); // Assertions - $this->assertEquals('block_comment', $updated_comment['comment_type']); - $this->assertEquals('1', $updated_comment['comment_approved']); + $this->assertEquals( 'block_comment', $updated_comment['comment_type'] ); + $this->assertEquals( '1', $updated_comment['comment_approved'] ); } /** @@ -35,14 +35,14 @@ public function test_update_comment_type_in_rest_api_6_7() { public function test_update_get_avatar_comment_type() { // Mock comment types - $comment_types = array('comment', 'pingback'); + $comment_types = array( 'comment', 'pingback' ); // Call the function - $updated_comment_types = update_get_avatar_comment_type($comment_types); + $updated_comment_types = update_get_avatar_comment_type( $comment_types ); // Assertions - $this->assertContains('block_comment', $updated_comment_types); - } + $this->assertContains( 'block_comment', $updated_comment_types ); + } /** * Tests that `update_comment_type_filter_dropdown` returns the correct options. @@ -53,10 +53,9 @@ public function test_update_comment_type_filter_dropdown() { $dropdown_options = update_comment_type_filter_dropdown(); // Assertions - $this->assertArrayHasKey('comment', $dropdown_options); - $this->assertArrayHasKey('block_comment', $dropdown_options); - $this->assertEquals(__('Comments'), $dropdown_options['comment']); - $this->assertEquals(__('Block Comments'), $dropdown_options['block_comment']); + $this->assertArrayHasKey( 'comment', $dropdown_options ); + $this->assertArrayHasKey( 'block_comment', $dropdown_options ); + $this->assertEquals( 'Comments', $dropdown_options['comment'] ); + $this->assertEquals( 'Block Comments', $dropdown_options['block_comment'] ); } - }