Tests: Ignore EOL differences in Style Engine 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.

This resolves two failures when running the test suite on Windows along the lines of:
{{{
1) Tests_Style_Engine_wpStyleEngineCSSRule::test_should_prettify_css_rule_output
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
 #Warning: Strings contain different line endings!
-'.baptiste {
-       margin-left: 0;
-       font-family: Detective Sans;
+'.baptiste {
+       margin-left: 0;
+       font-family: Detective Sans;
}'

/var/www/tests/phpunit/tests/style-engine/wpStyleEngineCssRule.php:159
}}}

Follow-up to [46612], [48443], [48466], [49691], [51135], [53282], [53319], [54156].

See #56467, #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@54394 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2022-10-05 14:04:05 +00:00
parent 0f922395cc
commit bb37d755bb
2 changed files with 2 additions and 2 deletions

View File

@ -156,6 +156,6 @@ class Tests_Style_Engine_wpStyleEngineCSSRule extends WP_UnitTestCase {
font-family: Detective Sans;
}';
$this->assertSame( $expected, $css_rule->get_css( true ) );
$this->assertSameIgnoreEOL( $expected, $css_rule->get_css( true ) );
}
}

View File

@ -92,7 +92,7 @@ class Tests_Style_Engine_wpStyleEngineProcessor extends WP_UnitTestCase {
background-color: orange;
}
';
$this->assertSame(
$this->assertSameIgnoreEOL(
$expected,
$a_wonderful_processor->get_css( array( 'prettify' => true ) )
);