function AttributeHelperTest::testMergeCollectionsArgumentException
@covers ::mergeCollections
File
-
core/
tests/ Drupal/ Tests/ Core/ Template/ AttributeHelperTest.php, line 72
Class
- AttributeHelperTest
- @coversDefaultClass \Drupal\Core\Template\AttributeHelper[[api-linebreak]] @group Template
Namespace
Drupal\Tests\Core\TemplateCode
public function testMergeCollectionsArgumentException() {
$attributes = new Attribute([
'class' => [
'example-class',
],
]);
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Invalid collection argument');
AttributeHelper::mergeCollections($attributes, 'not an array');
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Invalid collection argument');
AttributeHelper::mergeCollections('not an array', $attributes);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.