Skip to content

Commit

Permalink
remove spacing from unit testing file
Browse files Browse the repository at this point in the history
  • Loading branch information
rishishah-multidots committed Sep 11, 2024
1 parent 744a225 commit ba71390
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions phpunit/class-block-comment-filter-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ 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' => '',
'comment_approved' => '0',
);

// 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'] );
}

/**
Expand All @@ -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 );
}

Check failure on line 45 in phpunit/class-block-comment-filter-test.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Tabs must be used to indent lines; spaces are not allowed

/**
* Tests that `update_comment_type_filter_dropdown` returns the correct options.
Expand All @@ -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'] );
}

}

0 comments on commit ba71390

Please sign in to comment.