Changeset 48526 for trunk/tests/phpunit/tests/rest-api/rest-server.php
- Timestamp:
- 07/21/2020 12:01:10 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-server.php
r47351 r48526 67 67 '/test', 68 68 array( 69 'methods' => array( 'GET' ), 70 'callback' => '__return_null', 71 'args' => array( 69 'methods' => array( 'GET' ), 70 'callback' => '__return_null', 71 'permission_callback' => '__return_true', 72 'args' => array( 72 73 'foo' => array( 73 74 'default' => 'bar', … … 89 90 '/test', 90 91 array( 91 'methods' => array( 'GET' ), 92 'callback' => '__return_null', 93 'args' => array( 92 'methods' => array( 'GET' ), 93 'callback' => '__return_null', 94 'permission_callback' => '__return_true', 95 'args' => array( 94 96 'foo' => array( 95 97 'default' => 'bar', … … 111 113 '/test', 112 114 array( 113 'methods' => array( 'GET' ), 114 'callback' => '__return_null', 115 'args' => array( 115 'methods' => array( 'GET' ), 116 'callback' => '__return_null', 117 'permission_callback' => '__return_true', 118 'args' => array( 116 119 'foo' => array(), 117 120 ), … … 132 135 '/test', 133 136 array( 134 'methods' => array( 'GET' ), 135 'callback' => '__return_null', 136 'args' => array( 137 'methods' => array( 'GET' ), 138 'callback' => '__return_null', 139 'permission_callback' => '__return_true', 140 'args' => array( 137 141 'foo' => array( 138 142 'default' => 'bar', … … 151 155 '/test', 152 156 array( 153 'methods' => array( 'GET' ), 154 'callback' => '__return_true', 157 'methods' => array( 'GET' ), 158 'callback' => '__return_true', 159 'permission_callback' => '__return_true', 155 160 ) 156 161 ); … … 172 177 array( 173 178 array( 174 'methods' => array( 'HEAD' ), 175 'callback' => '__return_true', 179 'methods' => array( 'HEAD' ), 180 'callback' => '__return_true', 181 'permission_callback' => '__return_true', 176 182 ), 177 183 array( … … 194 200 array( 195 201 array( 196 'methods' => WP_REST_Server::READABLE, 197 'callback' => '__return_false', 198 'args' => array( 202 'methods' => WP_REST_Server::READABLE, 203 'callback' => '__return_false', 204 'permission_callback' => '__return_true', 205 'args' => array( 199 206 'data' => array(), 200 207 ), … … 267 274 '/test', 268 275 array( 269 'methods' => 'GET', 270 'callback' => '__return_null', 271 'should_exist' => false, 276 'methods' => 'GET', 277 'callback' => '__return_null', 278 'permission_callback' => '__return_true', 279 'should_exist' => false, 272 280 ) 273 281 ); … … 294 302 '/test', 295 303 array( 296 'methods' => 'GET', 297 'callback' => '__return_null', 298 'should_exist' => false, 304 'methods' => 'GET', 305 'callback' => '__return_null', 306 'permission_callback' => '__return_true', 307 'should_exist' => false, 299 308 ) 300 309 ); … … 304 313 '/test', 305 314 array( 306 'methods' => 'POST', 307 'callback' => '__return_null', 308 'should_exist' => false, 315 'methods' => 'POST', 316 'callback' => '__return_null', 317 'permission_callback' => '__return_true', 318 'should_exist' => false, 309 319 ) 310 320 ); … … 343 353 '/test', 344 354 array( 345 'methods' => 'POST', 346 'callback' => '__return_null', 347 'should_exist' => false, 355 'methods' => 'POST', 356 'callback' => '__return_null', 357 'permission_callback' => '__return_true', 358 'should_exist' => false, 348 359 ) 349 360 ); … … 366 377 array( 367 378 array( 368 'methods' => array( 'GET' ), 369 'callback' => '__return_null', 379 'methods' => array( 'GET' ), 380 'callback' => '__return_null', 381 'permission_callback' => '__return_true', 370 382 ), 371 383 array( … … 1328 1340 '/test', 1329 1341 array( 1330 'methods' => array( 'GET' ), 1331 'callback' => '__return_null', 1332 'args' => array( 1342 'methods' => array( 'GET' ), 1343 'callback' => '__return_null', 1344 'permission_callback' => '__return_true', 1345 'args' => array( 1333 1346 'someinteger' => array( 1334 1347 'validate_callback' => array( $this, '_validate_as_integer_123' ), … … 1363 1376 '/test', 1364 1377 array( 1365 'methods' => array( 'GET' ),1366 'callback' => function () {1378 'methods' => array( 'GET' ), 1379 'callback' => function () { 1367 1380 return new WP_REST_Response(); 1368 1381 }, 1382 'permission_callback' => '__return_true', 1369 1383 ) 1370 1384 ); … … 1384 1398 '/test', 1385 1399 array( 1386 'methods' => array( 'GET' ),1387 'callback' => function () {1400 'methods' => array( 'GET' ), 1401 'callback' => function () { 1388 1402 return new WP_REST_Response( 'data', 204 ); 1389 1403 }, 1404 'permission_callback' => '__return_true', 1390 1405 ) 1391 1406 ); … … 1474 1489 '/test', 1475 1490 array( 1476 'methods' => array( 'GET' ),1477 'callback' => function() {1491 'methods' => array( 'GET' ), 1492 'callback' => function() { 1478 1493 return new WP_REST_Response( 'data', 204 ); 1479 1494 }, 1495 'permission_callback' => '__return_true', 1480 1496 ) 1481 1497 ); … … 1484 1500 '/test', 1485 1501 array( 1486 'methods' => array( 'GET' ),1487 'callback' => function() {1502 'methods' => array( 'GET' ), 1503 'callback' => function() { 1488 1504 return new WP_REST_Response( 'data', 204 ); 1489 1505 }, 1506 'permission_callback' => '__return_true', 1490 1507 ) 1491 1508 );
Note: See TracChangeset
for help on using the changeset viewer.