Make WordPress Core


Ignore:
Timestamp:
10/26/2016 10:19:08 PM (9 years ago)
Author:
rachelbaker
Message:

REST API: Add the default_comment_status and default_ping_status options to the setting endpoint.

Props joehoyle.
See #38490.

File:
1 edited

Legend:

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

    r38832 r38971  
    5858            'default_post_format',
    5959            'posts_per_page',
     60            'default_ping_status',
     61            'default_comment_status',
    6062        ), array_keys( $data ) );
    6163    }
     
    229231    }
    230232
     233    public function test_update_item_with_invalid_enum() {
     234        update_option( 'posts_per_page', 9 );
     235
     236        wp_set_current_user( $this->administrator );
     237        $request = new WP_REST_Request( 'PUT', '/wp/v2/settings' );
     238        $request->set_param( 'default_ping_status', 'open&closed' );
     239        $response = $this->server->dispatch( $request );
     240        $this->assertErrorResponse( 'rest_invalid_param', $response, 400 );
     241    }
     242
    231243    public function test_delete_item() {
    232244    }
Note: See TracChangeset for help on using the changeset viewer.