diff --git a/core/tests/Drupal/Tests/Component/Attribute/AttributeTest.php b/core/tests/Drupal/Tests/Component/Attribute/AttributeTest.php index ffdb459..8f1379c 100644 --- a/core/tests/Drupal/Tests/Component/Attribute/AttributeTest.php +++ b/core/tests/Drupal/Tests/Component/Attribute/AttributeTest.php @@ -7,17 +7,17 @@ namespace Drupal\Tests\Component\Attribute; -use Drupal\Component\Utility\Html; use Drupal\Component\Attribute\Attribute; use Drupal\Component\Attribute\AttributeArray; use Drupal\Component\Attribute\AttributeString; -use Drupal\Core\Render\Markup; -use Drupal\Tests\UnitTestCase; use Drupal\Component\Render\MarkupInterface; +use Drupal\Component\Render\MarkupTrait; +use Drupal\Component\Utility\Html; +use Drupal\Tests\UnitTestCase; /** * @coversDefaultClass \Drupal\Component\Attribute\Attribute - * @group Template + * @group Attribute */ class AttributeTest extends UnitTestCase { @@ -367,10 +367,10 @@ public function providerTestAttributeValues() { $data = []; $string = '"> "'; - $data['safe-object-xss1'] = [['title' => Markup::create($string)], ' title=""> alert(123)""']; + $data['safe-object-xss1'] = [['title' => TestMarkup::create($string)], ' title=""> alert(123)""']; $data['non-safe-object-xss1'] = [['title' => $string], ' title="' . Html::escape($string) . '"']; $string = '">'; - $data['safe-object-xss2'] = [['title' => Markup::create($string)], ' title="">alert(123)"']; + $data['safe-object-xss2'] = [['title' => TestMarkup::create($string)], ' title="">alert(123)"']; $data['non-safe-object-xss2'] = [['title' => $string], ' title="' . Html::escape($string) . '"']; return $data; @@ -457,3 +457,7 @@ public function testStorage() { } } + +class TestMarkup implements MarkupInterface, \Countable { + use MarkupTrait; +}