public function LayoutDefaultTest::testBuild in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Layout/LayoutDefaultTest.php \Drupal\Tests\Core\Layout\LayoutDefaultTest::testBuild()
- 9 core/tests/Drupal/Tests/Core/Layout/LayoutDefaultTest.php \Drupal\Tests\Core\Layout\LayoutDefaultTest::testBuild()
@covers ::build @dataProvider providerTestBuild
File
- core/
tests/ Drupal/ Tests/ Core/ Layout/ LayoutDefaultTest.php, line 19
Class
- LayoutDefaultTest
- @coversDefaultClass \Drupal\Core\Layout\LayoutDefault @group Layout
Namespace
Drupal\Tests\Core\LayoutCode
public function testBuild($regions, $expected) {
$definition = new LayoutDefinition([
'theme_hook' => 'layout',
'library' => 'core/drupal',
'regions' => [
'left' => [
'label' => 'Left',
],
'right' => [
'label' => 'Right',
],
],
]);
$expected += [
'#settings' => [
'label' => '',
],
'#layout' => $definition,
'#theme' => 'layout',
'#attached' => [
'library' => [
'core/drupal',
],
],
];
$layout = new LayoutDefault([], '', $definition);
$this
->assertSame($expected, $layout
->build($regions));
}