You appear to be a bot. Output may be restricted
Description
Get item schema.
Usage
REST_Block_Renderer_Controller_Test::test_get_item_schema();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/rest-api/rest-block-renderer-controller.php
Lines:
1 to 20 of 20
public function test_get_item_schema() { $request = new WP_REST_Request( 'OPTIONS', self::$rest_api_route . self::$block_name ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); $this->assertSameSets( array( 'GET', 'POST' ), $data['endpoints'][0]['methods'] ); $this->assertSameSets( array( 'name', 'context', 'attributes', 'post_id' ), array_keys( $data['endpoints'][0]['args'] ) ); $this->assertSame( 'object', $data['endpoints'][0]['args']['attributes']['type'] ); $this->assertArrayHasKey( 'schema', $data ); $this->assertSame( 'rendered-block', $data['schema']['title'] ); $this->assertSame( 'object', $data['schema']['type'] ); $this->arrayHasKey( 'rendered', $data['schema']['properties'] ); $this->arrayHasKey( 'string', $data['schema']['properties']['rendered']['type'] ); $this->assertSame( array( 'edit' ), $data['schema']['properties']['rendered']['context'] ); }