Make WordPress Core


Ignore:
Timestamp:
07/27/2017 07:03:45 PM (7 years ago)
Author:
johnbillion
Message:

REST API: Add some missing assertions to various REST API tests.

See #41463

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-taxonomies-controller.php

    r39191 r41176  
    112112    public function test_create_item() {
    113113        /** Taxonomies can't be created **/
     114        $request = new WP_REST_Request( 'POST', '/wp/v2/taxonomies' );
     115        $response = $this->server->dispatch( $request );
     116        $this->assertEquals( 404, $response->get_status() );
    114117    }
    115118
    116119    public function test_update_item() {
    117120        /** Taxonomies can't be updated **/
     121        $request = new WP_REST_Request( 'POST', '/wp/v2/taxonomies/category' );
     122        $response = $this->server->dispatch( $request );
     123        $this->assertEquals( 404, $response->get_status() );
    118124    }
    119125
    120126    public function test_delete_item() {
    121127        /** Taxonomies can't be deleted **/
     128        $request = new WP_REST_Request( 'DELETE', '/wp/v2/taxonomies/category' );
     129        $response = $this->server->dispatch( $request );
     130        $this->assertEquals( 404, $response->get_status() );
    122131    }
    123132
Note: See TracChangeset for help on using the changeset viewer.