Changeset 64831
- Timestamp:
- 10/27/2026 07:45:02 PM (40 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-block-directory-controller.php
r64075 r64831 220 220 221 221 $this->assertSame( $expected, $response->get_data() ); 222 223 $links = test_rest_expand_compact_links( $response->get_links() ); 224 $this->assertArrayHasKey( 'https://api.w.org/install-plugin', $links ); 225 } 226 227 /** 228 * @ticket 40538 229 */ 230 public function test_prepare_item_limit_fields() { 231 wp_set_current_user( self::$admin_id ); 232 233 $controller = new WP_REST_Block_Directory_Controller(); 234 235 $plugin = $this->get_mock_plugin(); 236 $request = new WP_REST_Request( 'GET', '/wp/v2/block-directory/search' ); 237 $request->set_query_params( 238 array( 239 'term' => 'block', 240 '_fields' => 'id,name', 241 ) 242 ); 243 244 $response = $controller->prepare_item_for_response( $plugin, $request ); 245 246 $this->assertEmpty( $response->get_links(), 'Links should be omitted when not requested in _fields.' ); 222 247 } 223 248
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)