You are here

public function AttributesTest::testAttributeIteration in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Common/AttributesTest.php \Drupal\Tests\Core\Common\AttributesTest::testAttributeIteration()

Test attribute iteration

File

core/tests/Drupal/Tests/Core/Common/AttributesTest.php, line 67
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.');
  }
}