- Timestamp:
- 10/08/2019 01:41:29 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-posts-controller.php
r46434 r46435 4618 4618 } 4619 4619 4620 /** 4621 * @ticket 45677 4622 */ 4623 public function test_get_for_post_type_returns_null_for_invalid_provided_controller() { 4624 register_post_type( 4625 'test', 4626 array( 4627 'show_in_rest' => true, 4628 'rest_controller' => new \stdClass(), 4629 ) 4630 ); 4631 4632 $this->assertNull( get_post_type_object( 'test' )->get_rest_controller() ); 4633 } 4634 4635 /** 4636 * @ticket 45677 4637 */ 4638 public function test_get_for_post_type_returns_null_for_controller_class_mismatch() { 4639 register_post_type( 4640 'test', 4641 array( 4642 'show_in_rest' => true, 4643 'rest_controller_class' => WP_REST_Posts_Controller::class, 4644 'rest_controller' => new WP_REST_Terms_Controller( 'category' ), 4645 ) 4646 ); 4647 4648 $this->assertNull( get_post_type_object( 'test' )->get_rest_controller() ); 4649 } 4650 4620 4651 public function tearDown() { 4621 4652 _unregister_post_type( 'private-post' );
Note: See TracChangeset
for help on using the changeset viewer.