Changeset 47911 for trunk/tests/phpunit/tests/rest-api/rest-controller.php
- Timestamp:
- 06/04/2020 04:41:47 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-controller.php
r47753 r47911 246 246 247 247 $this->assertEquals( 'a', $args['somedefault']['default'] ); 248 } 249 250 /** 251 * @ticket 50301 252 */ 253 public function test_get_endpoint_args_for_item_schema_arg_properties() { 254 255 $controller = new WP_REST_Test_Controller(); 256 $args = $controller->get_endpoint_args_for_item_schema(); 257 258 foreach ( array( 'minLength', 'maxLength', 'pattern' ) as $property ) { 259 $this->assertArrayHasKey( $property, $args['somestring'] ); 260 } 261 262 foreach ( array( 'minimum', 'maximum', 'exclusiveMinimum', 'exclusiveMaximum' ) as $property ) { 263 $this->assertArrayHasKey( $property, $args['someinteger'] ); 264 } 265 266 $this->assertArrayHasKey( 'items', $args['somearray'] ); 267 268 foreach ( array( 'properties', 'additionalProperties' ) as $property ) { 269 $this->assertArrayHasKey( $property, $args['someobject'] ); 270 } 271 272 // ignored properties 273 $this->assertArrayNotHasKey( 'ignored_prop', $args['someobject'] ); 274 248 275 } 249 276 … … 268 295 'someargoptions', 269 296 'somedefault', 297 'somearray', 298 'someobject', 270 299 ), 271 300 $fields … … 299 328 'someargoptions', 300 329 'somedefault', 330 'somearray', 331 'someobject', 301 332 ), 302 333 ),
Note: See TracChangeset
for help on using the changeset viewer.