diff -u b/core/tests/Drupal/Tests/Component/Utility/XssTest.php b/core/tests/Drupal/Tests/Component/Utility/XssTest.php --- b/core/tests/Drupal/Tests/Component/Utility/XssTest.php +++ b/core/tests/Drupal/Tests/Component/Utility/XssTest.php @@ -506,14 +506,14 @@ public function providerTestAttributes() { return array( array( - 'Example: alt', - 'Example: alt', + 'Example: alt', + 'Example: alt', 'Image tag with alt and title attribute', array('img') ), array( - '', - '', + '', + '', 'Image tag with data attribute', array('img') ), @@ -666,6 +666,8 @@ */ public function testTruncateAttribute($value, $expected, $message, $allowed_tags = NULL) { $value = $this->convertFilterToTruncate($value, $expected, $allowed_tags); + // truncate, unlike filter calls normalize() so add a closing slash. + $expected = preg_replace('#(?$$#', ' />', $expected); $this->assertEquals($expected, $value, $message); }