diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/AttributesUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/AttributesUnitTest.php index 6910f7ad61f6fe3653e85207ca271625ffed3390..0e51b1ebf931529afe7e4ee8c256d44b0ad088b2 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/AttributesUnitTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/AttributesUnitTest.php @@ -29,6 +29,27 @@ function testDrupalAttributes() { // Verify that special characters are HTML encoded. $this->assertIdentical((string) new Attribute(array('title' => '&"\'<>')), ' title="&"'<>"', 'HTML encode attribute values.'); + // Verify that decimal NCR characters are preserved. + $this->assertIdentical((string) new Attribute(array('title' => 'Σ')), ' title="Σ"', 'Decimal NCR attribute values are preserved.'); + + // Verify that HTML encoded decimal NCR characters are preserved. + $this->assertIdentical((string) new Attribute(array('title' => '&#931;')), ' title="&#931;"', 'HTML Encoded decimal NCR attribute values are preserved.'); + + // Verify that hexadecimal NCR characters are preserved. + $this->assertIdentical((string) new Attribute(array('title' => 'Σ')), ' title="Σ"', 'Hexadecimal NCR attribute values are preserved.'); + + // Verify that HTML encoded hexadecimal NCR characters are preserved. + $this->assertIdentical((string) new Attribute(array('title' => '&#x03A3;')), ' title="&#x03A3;"', 'HTML Encoded hexadecimal NCR attribute values are preserved.'); + + // Verify that named characters are preserved. + $this->assertIdentical((string) new Attribute(array('title' => '®')), ' title="®"', 'Named character entity attribute values are preserved.'); + + // Verify that HTML encoded named characters are preserved. + $this->assertIdentical((string) new Attribute(array('title' => '&reg;')), ' title="&reg;"', 'HTML Encoded named character entity attribute values are preserved.'); + + // Verify that iconic Unicode characters are preserved. + $this->assertIdentical((string) new Attribute(array('title' => '©')), ' title="©"', 'Iconic Unicode character attribute values are preserved.'); + // Verify multi-value attributes are concatenated with spaces. $attributes = array('class' => array('first', 'last')); $this->assertIdentical((string) new Attribute(array('class' => array('first', 'last'))), ' class="first last"', 'Concatenate multi-value attributes.');