Changeset 51831
- Timestamp:
- 09/20/2021 07:58:09 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/abstract-testcase.php
r51698 r51831 725 725 * @since 5.9.0 Added the `$message` parameter. 726 726 * 727 * @param string|array$expected The expected value.728 * @param string|array$actual The actual value.729 * @param string 727 * @param mixed $expected The expected value. 728 * @param mixed $actual The actual value. 729 * @param string $message Optional. Message to display when the assertion fails. 730 730 */ 731 731 public function assertSameIgnoreEOL( $expected, $actual, $message = '' ) { 732 $expected = map_deep( 733 $expected, 734 static function ( $value ) { 735 return str_replace( "\r\n", "\n", $value ); 736 } 737 ); 738 739 $actual = map_deep( 740 $actual, 741 static function ( $value ) { 742 return str_replace( "\r\n", "\n", $value ); 743 } 744 ); 732 if ( null !== $expected ) { 733 $expected = map_deep( 734 $expected, 735 static function ( $value ) { 736 if ( is_string( $value ) ) { 737 return str_replace( "\r\n", "\n", $value ); 738 } 739 740 return $value; 741 } 742 ); 743 } 744 745 if ( null !== $actual ) { 746 $actual = map_deep( 747 $actual, 748 static function ( $value ) { 749 if ( is_string( $value ) ) { 750 return str_replace( "\r\n", "\n", $value ); 751 } 752 753 return $value; 754 } 755 ); 756 } 745 757 746 758 $this->assertSame( $expected, $actual, $message ); … … 754 766 * @since 5.9.0 Added the `$message` parameter. 755 767 * 756 * @param string$expected The expected value.757 * @param string$actual The actual value.768 * @param mixed $expected The expected value. 769 * @param mixed $actual The actual value. 758 770 * @param string $message Optional. Message to display when the assertion fails. 759 771 */
Note: See TracChangeset
for help on using the changeset viewer.