Changeset 53760 for trunk/tests/phpunit/tests/rest-api/rest-controller.php
- Timestamp:
- 07/22/2022 01:58:46 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-controller.php
r51908 r53760 387 387 'somearray', 388 388 'someobject', 389 '_links', 389 390 ), 390 391 $fields … … 422 423 'somearray', 423 424 'someobject', 424 ), 425 ), 426 ); 425 '_links', 426 ), 427 ), 428 ); 429 } 430 431 public function test_get_fields_for_response_respects_embed() { 432 $controller = new WP_REST_Test_Controller(); 433 $request = new WP_REST_Request( 'GET', '/wp/v2/testroute' ); 434 435 $this->assertNotContains( '_embedded', $controller->get_fields_for_response( $request ) ); 436 437 $request->set_param( '_embed', 1 ); 438 439 $this->assertContains( '_embedded', $controller->get_fields_for_response( $request ) ); 427 440 } 428 441
Note: See TracChangeset
for help on using the changeset viewer.