Changeset 38971
- Timestamp:
- 10/26/2016 10:19:08 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/option.php
r38916 r38971 1820 1820 'default' => 10, 1821 1821 ) ); 1822 1823 register_setting( 'discussion', 'default_ping_status', array( 1824 'show_in_rest' => array( 1825 'schema' => array( 1826 'enum' => array( 'open', 'closed' ), 1827 ), 1828 ), 1829 'type' => 'string', 1830 'description' => __( 'Allow link notifications from other blogs (pingbacks and trackbacks) on new articles.' ), 1831 ) ); 1832 1833 register_setting( 'discussion', 'default_comment_status', array( 1834 'show_in_rest' => array( 1835 'schema' => array( 1836 'enum' => array( 'open', 'closed' ), 1837 ), 1838 ), 1839 'type' => 'string', 1840 'description' => __( 'Allow people to post comments on new articles.' ), 1841 ) ); 1842 1822 1843 } 1823 1844 -
trunk/tests/phpunit/tests/rest-api/rest-settings-controller.php
r38832 r38971 58 58 'default_post_format', 59 59 'posts_per_page', 60 'default_ping_status', 61 'default_comment_status', 60 62 ), array_keys( $data ) ); 61 63 } … … 229 231 } 230 232 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 231 243 public function test_delete_item() { 232 244 }
Note: See TracChangeset
for help on using the changeset viewer.