/**
* Tests removing class attributes with the AttributeArray helper method.
* @covers ::removeClass
*/
public function testRemoveClasses() { // Add duplicate class to ensure that both duplicates are removed.
$classes =
['example-class', 'aa', 'xx', 'yy', 'red', 'green', 'blue', 'red'
];
$attribute =
new Attribute(['class' =>
$classes]);
// Remove one class.
$attribute->
removeClass('example-class'
);
$this->
assertNotContains('example-class',
$attribute['class'
]->
value());
// Remove multiple classes.
$attribute->
removeClass('xx', 'yy'
);
$this->
assertNotContains(['xx', 'yy'
],
$attribute['class'
]->
value());
// Remove an array of classes.
$attribute->
removeClass(['red', 'green', 'blue'
]);
$this->
assertNotContains(['red', 'green', 'blue'
],
$attribute['class'
]->
value());
// Remove a class that does not exist.