function AttributeTest::testStorage
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Template/AttributeTest.php \Drupal\Tests\Core\Template\AttributeTest::testStorage()
- 10 core/tests/Drupal/Tests/Core/Template/AttributeTest.php \Drupal\Tests\Core\Template\AttributeTest::testStorage()
- 11.x core/tests/Drupal/Tests/Core/Template/AttributeTest.php \Drupal\Tests\Core\Template\AttributeTest::testStorage()
Tests the storage method.
File
-
core/
tests/ Drupal/ Tests/ Core/ Template/ AttributeTest.php, line 449
Class
- AttributeTest
- @coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Template%21Attribute.php/class/Attribute/8.9.x" title="Collects, sanitizes, and renders HTML attributes." class="local">\Drupal\Core\Template\Attribute</a> @group Template
Namespace
Drupal\Tests\Core\TemplateCode
public function testStorage() {
$attribute = new Attribute([
'class' => [
'example-class',
],
]);
$this->assertEquals([
'class' => new AttributeArray('class', [
'example-class',
]),
], $attribute->storage());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.