Ticket #44939: 44939.diff
File 44939.diff, 2.0 KB (added by , 7 years ago) |
---|
-
tests/phpunit/tests/rest-api/rest-server.php
197 197 * Pass a capability which the user does not have, this should 198 198 * result in a 403 error. 199 199 */ 200 function test_rest_route_capability_authorization_fails() {200 public function test_rest_route_capability_authorization_fails() { 201 201 register_rest_route( 202 202 'test-ns', '/test', array( 203 203 'methods' => 'GET', … … 217 217 * An editor should be able to get access to an route with the 218 218 * edit_posts capability. 219 219 */ 220 function test_rest_route_capability_authorization() {220 public function test_rest_route_capability_authorization() { 221 221 register_rest_route( 222 222 'test-ns', '/test', array( 223 223 'methods' => 'GET', … … 242 242 * An "Allow" HTTP header should be sent with a request 243 243 * for all available methods on that route. 244 244 */ 245 function test_allow_header_sent() {245 public function test_allow_header_sent() { 246 246 247 247 register_rest_route( 248 248 'test-ns', '/test', array( … … 267 267 * The "Allow" HTTP header should include all available 268 268 * methods that can be sent to a route. 269 269 */ 270 function test_allow_header_sent_with_multiple_methods() {270 public function test_allow_header_sent_with_multiple_methods() { 271 271 272 272 register_rest_route( 273 273 'test-ns', '/test', array( … … 301 301 * The "Allow" HTTP header should NOT include other methods 302 302 * which the user does not have access to. 303 303 */ 304 function test_allow_header_send_only_permitted_methods() {304 public function test_allow_header_send_only_permitted_methods() { 305 305 306 306 register_rest_route( 307 307 'test-ns', '/test', array( … … 1106 1106 * } 1107 1107 * } 1108 1108 */ 1109 function data_rest_send_refreshed_nonce() {1109 public function data_rest_send_refreshed_nonce() { 1110 1110 return array( 1111 1111 array( true, true ), 1112 1112 array( true, false ),