Changeset 51480
- Timestamp:
- 07/22/2021 05:39:03 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/abstract-testcase.php
r51479 r51480 656 656 * Asserts that the given fields are present in the given object. 657 657 * 658 * @param object $object The object to check. 659 * @param array $fields The fields to check. 660 */ 661 public function assertEqualFields( $object, $fields ) { 658 * @since UT (3.7.0) 659 * @since 5.9.0 Added the `$message` parameter. 660 * 661 * @param object $object The object to check. 662 * @param array $fields The fields to check. 663 * @param string $message Optional. Message to display when the assertion fails. 664 */ 665 public function assertEqualFields( $object, $fields, $message = '' ) { 662 666 foreach ( $fields as $field_name => $field_value ) { 663 if ( $object->$field_name !== $field_value ) { 664 $this->fail(); 665 } 667 $this->assertSame( $object->$field_name, $field_value, $message . ' Field values do not match.' ); 666 668 } 667 669 }
Note: See TracChangeset
for help on using the changeset viewer.