You are here

public function AttributeTest::testSet in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 53
Contains \Drupal\Tests\Core\Template\AttributeTest.

Class

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

Namespace

Drupal\Tests\Core\Template

Code

public function testSet() {
  $attribute = new Attribute();
  $attribute['class'] = array(
    'example-class',
  );
  $this
    ->assertTrue(isset($attribute['class']));
  $this
    ->assertEquals(new AttributeArray('class', array(
    'example-class',
  )), $attribute['class']);
}