- Timestamp:
- 07/13/2018 06:28:29 AM (8 years ago)
- Location:
- branches/4.9
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
tests/phpunit/tests/rest-api/rest-taxonomies-controller.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.9
-
branches/4.9/tests/phpunit/tests/rest-api/rest-taxonomies-controller.php
r42427 r43443 52 52 $response = $this->server->dispatch( $request ); 53 53 $data = $response->get_data(); 54 $taxonomies = $this->get_public_taxonomies( get_taxonomies( '', 'objects' ) ); 55 $this->assertEquals( count( $taxonomies ), count( $data ) ); 56 $this->assertEquals( 'Categories', $data['category']['name'] ); 57 $this->assertEquals( 'category', $data['category']['slug'] ); 58 $this->assertEquals( true, $data['category']['hierarchical'] ); 59 $this->assertEquals( 'Tags', $data['post_tag']['name'] ); 60 $this->assertEquals( 'post_tag', $data['post_tag']['slug'] ); 61 $this->assertEquals( false, $data['post_tag']['hierarchical'] ); 62 $this->assertEquals( 'tags', $data['post_tag']['rest_base'] ); 63 } 64 65 public function test_get_items_context_edit() { 66 wp_set_current_user( self::$contributor_id ); 67 $request = new WP_REST_Request( 'GET', '/wp/v2/taxonomies' ); 68 $request->set_param( 'context', 'edit' ); 69 $response = rest_get_server()->dispatch( $request ); 70 $data = $response->get_data(); 54 71 $taxonomies = $this->get_public_taxonomies( get_taxonomies( '', 'objects' ) ); 55 72 $this->assertEquals( count( $taxonomies ), count( $data ) );
Note: See TracChangeset
for help on using the changeset viewer.