- Timestamp:
- 03/11/2025 02:17:41 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/wpRestBlockPatternCategoriesController.php
r59899 r59970 132 132 $response = rest_get_server()->dispatch( $request ); 133 133 $this->assertSame( 200, $response->get_status(), 'The response status should be 200.' ); 134 $this->assertNull( $response->get_data(), 'The server should not generate a body in response to a HEAD request.' ); 134 $this->assertSame( array(), $response->get_data(), 'The server should not generate a body in response to a HEAD request.' ); 135 } 136 137 /** 138 * @ticket 56481 139 * 140 * @param string $path The path to test. 141 */ 142 public function test_head_request_with_specified_fields_returns_success_response() { 143 wp_set_current_user( self::$admin_id ); 144 $request = new WP_REST_Request( 'HEAD', static::REQUEST_ROUTE ); 145 $request->set_param( '_fields', 'name' ); 146 $server = rest_get_server(); 147 $response = $server->dispatch( $request ); 148 add_filter( 'rest_post_dispatch', 'rest_filter_response_fields', 10, 3 ); 149 $response = apply_filters( 'rest_post_dispatch', $response, $server, $request ); 150 remove_filter( 'rest_post_dispatch', 'rest_filter_response_fields', 10 ); 151 152 $this->assertSame( 200, $response->get_status(), 'The response status should be 200.' ); 135 153 } 136 154
Note: See TracChangeset
for help on using the changeset viewer.