diff --git a/core/tests/Drupal/Tests/Core/Template/AttributeTest.php b/core/tests/Drupal/Tests/Core/Template/AttributeTest.php index b04eb51..701fc55 100644 --- a/core/tests/Drupal/Tests/Core/Template/AttributeTest.php +++ b/core/tests/Drupal/Tests/Core/Template/AttributeTest.php @@ -141,6 +141,19 @@ public function testRemoveClasses() { } /** + * Tests removing class attributes with the AttributeArray helper method. + * @covers ::hasClass() + */ + public function testHasClass() { + // Add duplicate class to ensure that both duplicates are removed. + $classes = array('example-class', 'we-totally-have-this-class'); + $attribute = new Attribute(array('class' => $classes)); + + $this->assertTrue($attribute->hasClass('we-totally-have-this-class')); + $this->assertFalse($attribute->hasClass('a-class-nowhere-to-be-found')); + } + + /** * Tests removing class attributes with the Attribute helper methods. * @covers ::removeClass() * @covers ::addClass()