- Timestamp:
- 08/17/2018 01:50:26 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-settings-controller.php
r42843 r43571 22 22 ); 23 23 24 self::$author 24 self::$author = $factory->user->create( 25 25 array( 26 26 'role' => 'author', … … 119 119 120 120 register_setting( 121 'somegroup', 'mycustomsetting', array( 121 'somegroup', 122 'mycustomsetting', 123 array( 122 124 'show_in_rest' => array( 123 125 'name' => 'mycustomsettinginrest', … … 153 155 154 156 register_setting( 155 'somegroup', 'mycustomsetting', array( 157 'somegroup', 158 'mycustomsetting', 159 array( 156 160 'show_in_rest' => array( 157 161 'schema' => array( … … 201 205 202 206 register_setting( 203 'somegroup', 'mycustomsetting', array( 207 'somegroup', 208 'mycustomsetting', 209 array( 204 210 'show_in_rest' => array( 205 211 'schema' => array( … … 236 242 // Invalid value 237 243 update_option( 238 'mycustomsetting', array( 244 'mycustomsetting', 245 array( 239 246 'a' => 1, 240 247 'b' => 2, … … 263 270 264 271 register_setting( 265 'somegroup', 'mycustomsetting1', array( 272 'somegroup', 273 'mycustomsetting1', 274 array( 266 275 'show_in_rest' => array( 267 276 'name' => 'mycustomsettinginrest1', … … 272 281 273 282 register_setting( 274 'somegroup', 'mycustomsetting2', array( 283 'somegroup', 284 'mycustomsetting2', 285 array( 275 286 'show_in_rest' => array( 276 287 'name' => 'mycustomsettinginrest2', … … 303 314 304 315 register_setting( 305 'somegroup', 'mycustomsetting', array( 316 'somegroup', 317 'mycustomsetting', 318 array( 306 319 'show_in_rest' => array( 307 320 'name' => 'mycustomsettinginrest', … … 327 340 328 341 register_setting( 329 'somegroup', 'mycustomsetting', array( 342 'somegroup', 343 'mycustomsetting', 344 array( 330 345 'show_in_rest' => array( 331 346 'name' => 'mycustomsettinginrest', … … 375 390 public function test_update_item_with_array() { 376 391 register_setting( 377 'somegroup', 'mycustomsetting', array( 392 'somegroup', 393 'mycustomsetting', 394 array( 378 395 'show_in_rest' => array( 379 396 'schema' => array( … … 419 436 public function test_update_item_with_nested_object() { 420 437 register_setting( 421 'somegroup', 'mycustomsetting', array( 438 'somegroup', 439 'mycustomsetting', 440 array( 422 441 'show_in_rest' => array( 423 442 'schema' => array( … … 446 465 $request = new WP_REST_Request( 'PUT', '/wp/v2/settings' ); 447 466 $request->set_param( 448 'mycustomsetting', array( 467 'mycustomsetting', 468 array( 449 469 'a' => array( 450 470 'b' => 1, … … 459 479 public function test_update_item_with_object() { 460 480 register_setting( 461 'somegroup', 'mycustomsetting', array( 481 'somegroup', 482 'mycustomsetting', 483 array( 462 484 'show_in_rest' => array( 463 485 'schema' => array( … … 497 519 $request = new WP_REST_Request( 'PUT', '/wp/v2/settings' ); 498 520 $request->set_param( 499 'mycustomsetting', array( 521 'mycustomsetting', 522 array( 500 523 'a' => 1, 501 524 'b' => 2, … … 599 622 600 623 register_setting( 601 'somegroup', 'mycustomsetting', array( 624 'somegroup', 625 'mycustomsetting', 626 array( 602 627 'show_in_rest' => true, 603 628 'type' => 'string',
Note: See TracChangeset
for help on using the changeset viewer.