You are here

public function AttributeTest::testRemove in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Template/AttributeTest.php \Drupal\Tests\Core\Template\AttributeTest::testRemove()

Tests removing of values.

File

core/tests/Drupal/Tests/Core/Template/AttributeTest.php, line 71

Class

AttributeTest
@coversDefaultClass \Drupal\Core\Template\Attribute @group Template

Namespace

Drupal\Tests\Core\Template

Code

public function testRemove() {
  $attribute = new Attribute([
    'class' => [
      'example-class',
    ],
  ]);
  unset($attribute['class']);
  $this
    ->assertFalse(isset($attribute['class']));
}