public function LayoutClassesPluginDefinitionFormatTest::testClassesBuild in Layout Section Classes 8
@covers ::build
File
- tests/
src/ Unit/ LayoutClassesPluginDefinitionFormatTest.php, line 21
Class
- LayoutClassesPluginDefinitionFormatTest
- @coversDefaultClass \Drupal\layout_section_classes\ClassyLayout @group layout_section_classes
Namespace
Drupal\Tests\layout_section_classes\UnitCode
public function testClassesBuild() {
$configuration = [
'additional' => [
'classes' => [
'foo' => [
'class_1',
'class_2',
],
'bar' => 'class_3',
'baz' => '',
'qux' => [
'',
],
],
],
];
$plugin = new ClassyLayout($configuration, 'foo_plugin', new LayoutDefinition([]));
$build = $plugin
->build([]);
$this
->assertEquals([
'class_1',
'class_2',
'class_3',
], $build['#attributes']['class']);
}