function AttributeTest::testMergeArgumentException

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Template/AttributeTest.php \Drupal\Tests\Core\Template\AttributeTest::testMergeArgumentException()
  2. 8.9.x core/tests/Drupal/Tests/Core/Template/AttributeTest.php \Drupal\Tests\Core\Template\AttributeTest::testMergeArgumentException()
  3. 11.x core/tests/Drupal/Tests/Core/Template/AttributeTest.php \Drupal\Tests\Core\Template\AttributeTest::testMergeArgumentException()

@covers ::merge

File

core/tests/Drupal/Tests/Core/Template/AttributeTest.php, line 519

Class

AttributeTest
@coversDefaultClass \Drupal\Core\Template\Attribute[[api-linebreak]] @group Template

Namespace

Drupal\Tests\Core\Template

Code

public function testMergeArgumentException() : void {
  $attributes = new Attribute([
    'class' => [
      'example-class',
    ],
  ]);
  $this->expectException(\TypeError::class);
  $attributes->merge('not an array');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.