function LayoutDefaultTest::testBuild
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Layout/LayoutDefaultTest.php \Drupal\Tests\Core\Layout\LayoutDefaultTest::testBuild()
- 8.9.x core/tests/Drupal/Tests/Core/Layout/LayoutDefaultTest.php \Drupal\Tests\Core\Layout\LayoutDefaultTest::testBuild()
- 11.x 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 21
Class
- LayoutDefaultTest
- @coversDefaultClass \Drupal\Core\Layout\LayoutDefault @group Layout
Namespace
Drupal\Tests\Core\LayoutCode
public function testBuild($regions, $expected) : void {
$definition = new LayoutDefinition([
'theme_hook' => 'layout',
'library' => 'core/drupal',
'regions' => [
'left' => [
'label' => 'Left',
],
'right' => [
'label' => 'Right',
],
],
]);
$expected += [
'#in_preview' => FALSE,
'#settings' => [
'label' => '',
],
'#layout' => $definition,
'#theme' => 'layout',
'#attached' => [
'library' => [
'core/drupal',
],
],
];
$layout = new LayoutDefault([], '', $definition);
$this->assertSame($expected, $layout->build($regions));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.