function AttributeTest::testSet
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Template/AttributeTest.php \Drupal\Tests\Core\Template\AttributeTest::testSet()
- 8.9.x core/tests/Drupal/Tests/Core/Template/AttributeTest.php \Drupal\Tests\Core\Template\AttributeTest::testSet()
- 10 core/tests/Drupal/Tests/Core/Template/AttributeTest.php \Drupal\Tests\Core\Template\AttributeTest::testSet()
Tests set of values.
File
-
core/
tests/ Drupal/ Tests/ Core/ Template/ AttributeTest.php, line 52
Class
- AttributeTest
- @coversDefaultClass \Drupal\Core\Template\Attribute @group Template
Namespace
Drupal\Tests\Core\TemplateCode
public function testSet() : void {
$attribute = new Attribute();
$attribute['class'] = [
'example-class',
];
$this->assertTrue(isset($attribute['class']));
$this->assertEquals(new AttributeArray('class', [
'example-class',
]), $attribute['class']);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.