@@ 415-423 (lines=9) @@ | ||
412 | $this->assertEquals( 'Child', $data[0]['name'] ); |
|
413 | } |
|
414 | ||
415 | public function test_get_terms_private_taxonomy() { |
|
416 | register_taxonomy( 'robin', 'post', array( 'public' => false ) ); |
|
417 | $this->factory->term->create( array( 'name' => 'Cape', 'taxonomy' => 'robin' ) ); |
|
418 | $this->factory->term->create( array( 'name' => 'Mask', 'taxonomy' => 'robin' ) ); |
|
419 | ||
420 | $request = new WP_REST_Request( 'GET', '/wp/v2/terms/robin' ); |
|
421 | $response = $this->server->dispatch( $request ); |
|
422 | $this->assertErrorResponse( 'rest_no_route', $response, 404 ); |
|
423 | } |
|
424 | ||
425 | public function test_get_terms_invalid_taxonomy() { |
|
426 | $request = new WP_REST_Request( 'GET', '/wp/v2/invalid-taxonomy' ); |
@@ 332-340 (lines=9) @@ | ||
329 | $this->assertEquals( 'Apple', $data[0]['name'] ); |
|
330 | } |
|
331 | ||
332 | public function test_get_terms_private_taxonomy() { |
|
333 | register_taxonomy( 'robin', 'post', array( 'public' => false ) ); |
|
334 | $term1 = $this->factory->term->create( array( 'name' => 'Cape', 'taxonomy' => 'robin' ) ); |
|
335 | $term2 = $this->factory->term->create( array( 'name' => 'Mask', 'taxonomy' => 'robin' ) ); |
|
336 | ||
337 | $request = new WP_REST_Request( 'GET', '/wp/v2/terms/robin' ); |
|
338 | $response = $this->server->dispatch( $request ); |
|
339 | $this->assertErrorResponse( 'rest_no_route', $response, 404 ); |
|
340 | } |
|
341 | ||
342 | public function test_get_terms_pagination_headers() { |
|
343 | // Start of the index |