Skip to content

Commit

Permalink
Add unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-vlasenko committed Dec 30, 2024
1 parent 5eb42b9 commit 0ed0163
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/phpunit/tests/rest-api/rest-widget-types-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,17 @@ public function test_get_items() {
}
}

/**
* @ticket 56481
*/
public function test_get_items_with_head_request_should_not_prepare_post_data() {
wp_set_current_user( self::$admin_id );
$request = new WP_REST_Request( 'HEAD', '/wp/v2/widget-types' );
$response = rest_get_server()->dispatch( $request );
$this->assertSame( 200, $response->get_status(), 'The response status should be 200.' );
$this->assertNull( $response->get_data(), 'The server should not generate a body in response to a HEAD request.' );
}

/**
* @ticket 53303
*/
Expand Down

0 comments on commit 0ed0163

Please sign in to comment.