Changeset 43571 for trunk/tests/phpunit/tests/meta/registerMeta.php
- Timestamp:
- 08/17/2018 01:50:26 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/meta/registerMeta.php
r43378 r43571 69 69 'auth' => 10, 70 70 'sanitize' => 10, 71 ), $has_filters 71 ), 72 $has_filters 72 73 ); 73 74 } … … 431 432 432 433 // This will override the above registration for objects of $subtype. 433 register_meta( $type, 'registered_key1', array( 434 'object_subtype' => $subtype, 435 'single' => true, 436 ) ); 434 register_meta( 435 $type, 436 'registered_key1', 437 array( 438 'object_subtype' => $subtype, 439 'single' => true, 440 ) 441 ); 437 442 438 443 // For testing with $single => false. 439 register_meta( $type, 'registered_key2', array( 440 'object_subtype' => $subtype, 441 ) ); 444 register_meta( 445 $type, 446 'registered_key2', 447 array( 448 'object_subtype' => $subtype, 449 ) 450 ); 442 451 443 452 // Register another meta key for a different subtype. 444 register_meta( $type, 'registered_key3', array( 445 'object_subtype' => 'other_subtype', 446 ) ); 453 register_meta( 454 $type, 455 'registered_key3', 456 array( 457 'object_subtype' => 'other_subtype', 458 ) 459 ); 447 460 448 461 $object_property_name = $type . '_id'; 449 $object_id = self::$$object_property_name;462 $object_id = self::$$object_property_name; 450 463 451 464 add_metadata( $type, $object_id, 'registered_key1', 'value1' ); … … 474 487 public function test_get_object_subtype( $type, $expected_subtype ) { 475 488 $object_property_name = $type . '_id'; 476 $object_id = self::$$object_property_name;489 $object_id = self::$$object_property_name; 477 490 478 491 $this->assertSame( $expected_subtype, get_object_subtype( $type, $object_id ) );
Note: See TracChangeset
for help on using the changeset viewer.