Make WordPress Core

Changeset 38917


Ignore:
Timestamp:
10/25/2016 07:33:34 PM (7 years ago)
Author:
jeremyfelt
Message:

REST API: Adjust test_get_items_invalid_status_param_is_discarded() after [38911].

Previously, if an invalid post status was assigned to a media object, the object would be returned with an unchanged status. After [38911], an error response is returned.

The assertion in test_get_items_invalid_status_param_is_discarded() needs to be updated to account for the expected error response. The test name has been changed to test_get_items_invalid_status_param_is_error_response().

Fixes #38417.

File:
1 edited

Legend:

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

    r38834 r38917  
    281281    }
    282282
    283     public function test_get_items_invalid_status_param_is_discarded() {
     283    public function test_get_items_invalid_status_param_is_error_response() {
    284284        wp_set_current_user( $this->editor_id );
    285285        $this->factory->attachment->create_object( $this->test_file, 0, array(
     
    292292        $response = $this->server->dispatch( $request );
    293293        $data = $response->get_data();
    294         $this->assertCount( 1, $data );
    295         $this->assertEquals( 'inherit', $data[0]['status'] );
     294        $this->assertCount( 3, $data );
     295        $this->assertEquals( 'rest_invalid_param', $data['code'] );
    296296    }
    297297
Note: See TracChangeset for help on using the changeset viewer.