- Timestamp:
- 04/30/2018 04:30:23 AM (7 years ago)
- Location:
- branches/4.9
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.9
-
branches/4.9/tests/phpunit/tests/rest-api/rest-post-types-controller.php
r41176 r43038 129 129 $data = $response->get_data(); 130 130 $properties = $data['schema']['properties']; 131 $this->assertEquals( 9, count( $properties ) );131 $this->assertEquals( 10, count( $properties ) ); 132 132 $this->assertArrayHasKey( 'capabilities', $properties ); 133 133 $this->assertArrayHasKey( 'description', $properties ); 134 134 $this->assertArrayHasKey( 'hierarchical', $properties ); 135 $this->assertArrayHasKey( 'viewable', $properties ); 135 136 $this->assertArrayHasKey( 'labels', $properties ); 136 137 $this->assertArrayHasKey( 'name', $properties ); … … 190 191 $this->assertEquals( $post_type_obj->cap, $data['capabilities'] ); 191 192 $this->assertEquals( $post_type_obj->labels, $data['labels'] ); 193 if ( in_array( $post_type_obj->name, array( 'post', 'page' ), true ) ) { 194 $viewable = true; 195 } else { 196 $viewable = is_post_type_viewable( $post_type_obj ); 197 } 198 $this->assertEquals( $viewable, $data['viewable'] ); 192 199 $this->assertEquals( get_all_post_type_supports( $post_type_obj->name ), $data['supports'] ); 193 200 } else { 194 201 $this->assertFalse( isset( $data['capabilities'] ) ); 202 $this->assertFalse( isset( $data['viewable'] ) ); 195 203 $this->assertFalse( isset( $data['labels'] ) ); 196 204 $this->assertFalse( isset( $data['supports'] ) );
Note: See TracChangeset
for help on using the changeset viewer.