Changeset 64437
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r64433 r64437 2901 2901 'properties' => array( 2902 2902 'content' => array( 2903 'raw' => array( 2904 'type' => 'string', 2903 'type' => 'object', 2904 'properties' => array( 2905 'raw' => array( 2906 'type' => 'string', 2907 ), 2905 2908 ), 2906 2909 ), -
trunk/tests/phpunit/tests/rest-api/rest-posts-controller.php
r64343 r64437 5208 5208 } 5209 5209 5210 /** 5211 * @ticket 66332 5212 * 5213 * @covers WP_REST_Posts_Controller::get_schema_links 5214 */ 5215 public function test_unfiltered_html_action_ldo_target_schema() { 5216 $response = rest_get_server()->dispatch( new WP_REST_Request( 'OPTIONS', '/wp/v2/posts' ) ); 5217 $data = $response->get_data(); 5218 $schema = $data['schema']; 5219 5220 $this->assertArrayHasKey( 'links', $schema, 'The schema should have links.' ); 5221 $unfiltered_html = wp_list_filter( $schema['links'], array( 'rel' => 'https://api.w.org/action-unfiltered-html' ) ); 5222 5223 $this->assertCount( 1, $unfiltered_html, 'The action-unfiltered-html LDO should be on the schema once.' ); 5224 5225 $ldo = array_shift( $unfiltered_html ); 5226 5227 $this->assertSame( 5228 array( 5229 'type' => 'object', 5230 'properties' => array( 5231 'content' => array( 5232 'type' => 'object', 5233 'properties' => array( 5234 'raw' => array( 5235 'type' => 'string', 5236 ), 5237 ), 5238 ), 5239 ), 5240 ), 5241 $ldo['targetSchema'], 5242 'The target schema should describe content.raw as a string.' 5243 ); 5244 } 5245 5210 5246 public function test_sticky_action_ldo_registered_for_posts() { 5211 5247 $response = rest_get_server()->dispatch( new WP_REST_Request( 'OPTIONS', '/wp/v2/posts' ) );
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)