diff --git src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
index f9de7360bd..cb8620afdb 100644
|
|
|
class WP_REST_Posts_Controller extends WP_REST_Controller { |
| 1814 | 1814 | 'title', |
| 1815 | 1815 | 'editor', |
| 1816 | 1816 | 'author', |
| 1817 | | 'excerpt', |
| 1818 | 1817 | 'thumbnail', |
| 1819 | 1818 | 'comments', |
| 1820 | 1819 | 'revisions', |
diff --git tests/phpunit/tests/rest-api/rest-pages-controller.php tests/phpunit/tests/rest-api/rest-pages-controller.php
index ee24f7af69..105f49c9a6 100644
|
|
|
class WP_Test_REST_Pages_Controller extends WP_Test_REST_Post_Type_Controller_Te |
| 446 | 446 | $data = $response->get_data(); |
| 447 | 447 | $this->assertEquals( '', $data['content']['rendered'] ); |
| 448 | 448 | $this->assertTrue( $data['content']['protected'] ); |
| 449 | | $this->assertEquals( '', $data['excerpt']['rendered'] ); |
| 450 | | $this->assertTrue( $data['excerpt']['protected'] ); |
| | 449 | $this->assertArrayNotHasKey( 'excerpt', $data ); |
| 451 | 450 | } |
| 452 | 451 | |
| 453 | 452 | public function test_get_page_with_password_using_password() { |
| … |
… |
class WP_Test_REST_Pages_Controller extends WP_Test_REST_Post_Type_Controller_Te |
| 466 | 465 | $data = $response->get_data(); |
| 467 | 466 | $this->assertEquals( wpautop( $page->post_content ), $data['content']['rendered'] ); |
| 468 | 467 | $this->assertTrue( $data['content']['protected'] ); |
| 469 | | $this->assertEquals( wpautop( $page->post_excerpt ), $data['excerpt']['rendered'] ); |
| 470 | | $this->assertTrue( $data['excerpt']['protected'] ); |
| | 468 | $this->assertArrayNotHasKey( 'excerpt', $data ); |
| 471 | 469 | } |
| 472 | 470 | |
| 473 | 471 | public function test_get_page_with_password_using_incorrect_password() { |
| … |
… |
class WP_Test_REST_Pages_Controller extends WP_Test_REST_Post_Type_Controller_Te |
| 496 | 494 | $data = $response->get_data(); |
| 497 | 495 | $this->assertEquals( '', $data['content']['rendered'] ); |
| 498 | 496 | $this->assertTrue( $data['content']['protected'] ); |
| 499 | | $this->assertEquals( '', $data['excerpt']['rendered'] ); |
| 500 | | $this->assertTrue( $data['excerpt']['protected'] ); |
| | 497 | $this->assertArrayNotHasKey( 'excerpt', $data ); |
| 501 | 498 | } |
| 502 | 499 | |
| 503 | 500 | public function test_get_item_schema() { |
| … |
… |
class WP_Test_REST_Pages_Controller extends WP_Test_REST_Post_Type_Controller_Te |
| 505 | 502 | $response = $this->server->dispatch( $request ); |
| 506 | 503 | $data = $response->get_data(); |
| 507 | 504 | $properties = $data['schema']['properties']; |
| 508 | | $this->assertEquals( 22, count( $properties ) ); |
| | 505 | $this->assertEquals( 21, count( $properties ) ); |
| 509 | 506 | $this->assertArrayHasKey( 'author', $properties ); |
| 510 | 507 | $this->assertArrayHasKey( 'comment_status', $properties ); |
| 511 | 508 | $this->assertArrayHasKey( 'content', $properties ); |
| 512 | 509 | $this->assertArrayHasKey( 'date', $properties ); |
| 513 | 510 | $this->assertArrayHasKey( 'date_gmt', $properties ); |
| 514 | 511 | $this->assertArrayHasKey( 'guid', $properties ); |
| 515 | | $this->assertArrayHasKey( 'excerpt', $properties ); |
| | 512 | $this->assertArrayNotHasKey( 'excerpt', $properties ); |
| 516 | 513 | $this->assertArrayHasKey( 'featured_media', $properties ); |
| 517 | 514 | $this->assertArrayHasKey( 'id', $properties ); |
| 518 | 515 | $this->assertArrayHasKey( 'link', $properties ); |