WordPress.org

Make WordPress Core


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

    r38832 r41176  
    102102    public function test_create_item() {
    103103        /** Post statuses can't be created **/
     104        $request = new WP_REST_Request( 'POST', '/wp/v2/statuses' );
     105        $response = $this->server->dispatch( $request );
     106        $this->assertEquals( 404, $response->get_status() );
    104107    }
    105108
    106109    public function test_update_item() {
    107110        /** Post statuses can't be updated **/
     111        $request = new WP_REST_Request( 'POST', '/wp/v2/statuses/draft' );
     112        $response = $this->server->dispatch( $request );
     113        $this->assertEquals( 404, $response->get_status() );
    108114    }
    109115
    110116    public function test_delete_item() {
    111117        /** Post statuses can't be deleted **/
     118        $request = new WP_REST_Request( 'DELETE', '/wp/v2/statuses/draft' );
     119        $response = $this->server->dispatch( $request );
     120        $this->assertEquals( 404, $response->get_status() );
    112121    }
    113122
Note: See TracChangeset for help on using the changeset viewer.