You appear to be a bot. Output may be restricted
Description
Usage
REST_Block_Type_Controller_Test::test_get_item_defaults();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/rest-api/rest-block-type-controller.php
Lines:
1 to 53 of 53
public function test_get_item_defaults() { $block_type = 'fake/false'; $settings = array( 'title' => false, 'description' => false, 'icon' => false, 'attributes' => false, 'provides_context' => false, 'uses_context' => false, 'category' => false, 'editor_script' => false, 'script' => false, 'view_script' => false, 'editor_style' => false, 'style' => false, 'keywords' => false, 'parent' => false, 'supports' => false, 'styles' => false, 'render_callback' => false, 'textdomain' => false, 'example' => false, 'variations' => false, ); register_block_type( $block_type, $settings ); wp_set_current_user( self::$admin_id ); $request = new WP_REST_Request( 'GET', '/wp/v2/block-types/' . $block_type ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); $this->assertSame( $block_type, $data['name'] ); $this->assertSame( '', $data['title'] ); $this->assertSame( '', $data['description'] ); $this->assertNull( $data['icon'] ); $this->assertNull( $data['editor_script'] ); $this->assertNull( $data['script'] ); $this->assertNull( $data['view_script'] ); $this->assertNull( $data['editor_style'] ); $this->assertNull( $data['style'] ); $this->assertSameSets( array(), $data['attributes'] ); $this->assertSameSets( array(), $data['provides_context'] ); $this->assertSameSets( array(), $data['uses_context'] ); $this->assertSameSets( array(), $data['keywords'] ); $this->assertSameSets( array(), $data['parent'] ); $this->assertSameSets( array(), $data['supports'] ); $this->assertSameSets( array(), $data['styles'] ); $this->assertNull( $data['example'] ); $this->assertNull( $data['category'] ); $this->assertNull( $data['example'] ); $this->assertNull( $data['textdomain'] ); $this->assertFalse( $data['is_dynamic'] ); $this->assertSameSets( array(), $data['variations'] ); }