Make WordPress Core


Ignore:
Timestamp:
07/27/2017 07:03:45 PM (9 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-post-types-controller.php

    r39647 r41176  
    9696        public function test_create_item() {
    9797                /** Post types can't be created **/
     98                $request = new WP_REST_Request( 'POST', '/wp/v2/types' );
     99                $response = $this->server->dispatch( $request );
     100                $this->assertEquals( 404, $response->get_status() );
    98101        }
    99102
    100103        public function test_update_item() {
    101104                /** Post types can't be updated **/
     105                $request = new WP_REST_Request( 'POST', '/wp/v2/types/post' );
     106                $response = $this->server->dispatch( $request );
     107                $this->assertEquals( 404, $response->get_status() );
    102108        }
    103109
    104110        public function test_delete_item() {
    105111                /** Post types can't be deleted **/
     112                $request = new WP_REST_Request( 'DELETE', '/wp/v2/types/post' );
     113                $response = $this->server->dispatch( $request );
     114                $this->assertEquals( 404, $response->get_status() );
    106115        }
    107116
Note: See TracChangeset for help on using the changeset viewer.