public function AttributesTest::testAttributeIteration

Test attribute iteration

File

drupal/core/tests/Drupal/Tests/Core/Common/AttributesTest.php, line 69
Contains \Drupal\Tests\Core\Common\AttributesTest.

Class

AttributesTest
Tests the Drupal\Core\Template\Attribute functionality.

Namespace

Drupal\Tests\Core\Common

Code

public function testAttributeIteration() {
  $attribute = new Attribute(array(
    'key1' => 'value1',
  ));
  foreach ($attribute as $value) {
    $this
      ->assertSame((string) $value, 'value1', 'Iterate over attribute.');
  }
}