function AttributeTest::testStorage

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Template/AttributeTest.php \Drupal\Tests\Core\Template\AttributeTest::testStorage()
  2. 10 core/tests/Drupal/Tests/Core/Template/AttributeTest.php \Drupal\Tests\Core\Template\AttributeTest::testStorage()
  3. 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 460

Class

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

Namespace

Drupal\Tests\Core\Template

Code

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.