From 80fae63d57f0eb8acfc3773de69640d5caa1cd4c Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 14 Jul 2020 01:40:33 +0000 Subject: [PATCH] Tests: Ignore EOL differences in some tests using multiline string assertions. Unix vs. Windows EOL style mismatches can cause misleading failures in tests using the heredoc syntax (`<<<`) or multiline strings as the expected result. Follow-up to [46612], [48443]. See #31432. git-svn-id: https://develop.svn.wordpress.org/trunk@48466 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/dependencies/scripts.php | 2 +- tests/phpunit/tests/functions/cleanupHeaderComment.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/dependencies/scripts.php b/tests/phpunit/tests/dependencies/scripts.php index 093f02f1e9..20489390d6 100644 --- a/tests/phpunit/tests/dependencies/scripts.php +++ b/tests/phpunit/tests/dependencies/scripts.php @@ -752,7 +752,7 @@ JS; $print_scripts // Printed scripts. ); - $this->assertEquals( $expected, $print_scripts ); + $this->assertEqualsIgnoreEOL( $expected, $print_scripts ); } /** diff --git a/tests/phpunit/tests/functions/cleanupHeaderComment.php b/tests/phpunit/tests/functions/cleanupHeaderComment.php index 825523bf7a..bf79b65d4c 100644 --- a/tests/phpunit/tests/functions/cleanupHeaderComment.php +++ b/tests/phpunit/tests/functions/cleanupHeaderComment.php @@ -17,7 +17,7 @@ class Tests_Functions_CleanupHeaderComment extends WP_UnitTestCase { * @param string $expected */ public function test_cleanup_header_comment( $test_string, $expected ) { - $this->assertEquals( $expected, _cleanup_header_comment( $test_string ) ); + $this->assertEqualsIgnoreEOL( $expected, _cleanup_header_comment( $test_string ) ); } /**