From 6eeaa587e780e294d5b33c75299fc6909a7b63b5 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 30 Apr 2022 11:33:30 +0000 Subject: [PATCH] Tests: Ignore EOL differences in Webfonts API tests. Unix vs. Windows EOL style mismatches can cause misleading failures in tests using the heredoc syntax (`<<<`) or multiline strings as the expected result. Includes renaming the test class to match the [https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization naming conventions]. Follow-up to [46612], [48443], [48466], [49691], [51135], [53282]. See #54725. git-svn-id: https://develop.svn.wordpress.org/trunk@53319 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/webfonts/wpThemeJsonWebfontsHandler.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/webfonts/wpThemeJsonWebfontsHandler.php b/tests/phpunit/tests/webfonts/wpThemeJsonWebfontsHandler.php index df50c5079a..5c609923d7 100644 --- a/tests/phpunit/tests/webfonts/wpThemeJsonWebfontsHandler.php +++ b/tests/phpunit/tests/webfonts/wpThemeJsonWebfontsHandler.php @@ -2,7 +2,7 @@ /** * Enqueue only webfonts listed in theme.json * - * @package WordPress + * @package WordPress */ /** @@ -12,7 +12,7 @@ * @group themes * @covers _wp_theme_json_webfonts_handler */ -class Test_WebfontsApi_WpThemeJsonWebfontsHandler extends WP_UnitTestCase { +class Tests_Webfonts_wpThemeJsonWebfontsHandler extends WP_UnitTestCase { /** * WP_Styles instance reference @@ -86,6 +86,7 @@ class Test_WebfontsApi_WpThemeJsonWebfontsHandler extends WP_UnitTestCase { EOF; $expected = str_replace( 'THEME_ROOT_URL', get_stylesheet_directory_uri(), $expected ); + $expected = str_replace( "\r\n", "\n", $expected ); $this->assertStringContainsString( $expected,