diff --git a/core/modules/locale/src/Tests/LocaleStringIsSafeTest.php b/core/modules/locale/src/Tests/LocaleStringIsSafeTest.php index fef06a0..424ce06 100644 --- a/core/modules/locale/src/Tests/LocaleStringIsSafeTest.php +++ b/core/modules/locale/src/Tests/LocaleStringIsSafeTest.php @@ -51,6 +51,9 @@ public function testLocaleStringIsSafe() { /** * Tests if a translated and tokenized string is properly escaped by Twig. + * + * In each assert* call we add a new line at the expected result to match the + * newline at the end of the template file. */ public function testLocalizedTokenizedString() { $tests_to_do = array( @@ -71,7 +74,7 @@ public function testLocalizedTokenizedString() { // original and the rendered version should be different. $this->assertNotEqual( $rendered_original_string, - $original_string, + $original_string . "\n", 'Security test ' . $i . ' before translation' ); @@ -82,7 +85,7 @@ public function testLocalizedTokenizedString() { // and should be the same as the original. $this->assertEqual( $rendered_safe_string, - $original_string, + $original_string . "\n", 'Security test ' . $i . ' after translation before token replacement' ); @@ -94,7 +97,7 @@ public function testLocalizedTokenizedString() { // anymore. Check it is escaped the way we expect. $this->assertEqual( $rendered_unsafe_string, - $test['replaced'], + $test['replaced'] . "\n", 'Security test ' . $i . ' after translation after token replacement' ); }