function AttributeHelperTest::testMergeCollectionsAttributeWithStringArgumentException

Tests merge collections argument exception.

File

core/tests/Drupal/Tests/Core/Template/AttributeHelperTest.php, line 94

Class

AttributeHelperTest
Tests Drupal\Core\Template\AttributeHelper.

Namespace

Drupal\Tests\Core\Template

Code

public function testMergeCollectionsAttributeWithStringArgumentException() : void {
  $attributes = new Attribute([
    'class' => [
      'example-class',
    ],
  ]);
  $this->expectException(\InvalidArgumentException::class);
  $this->expectExceptionMessageIs('Invalid collection argument');
  // @phpstan-ignore argument.type
  AttributeHelper::mergeCollections($attributes, 'not an array');
}

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