3 namespace Drupal\Tests\Core\Layout;
5 use Drupal\Core\Layout\LayoutDefault;
6 use Drupal\Core\Layout\LayoutDefinition;
7 use Drupal\Tests\UnitTestCase;
10 * @coversDefaultClass \Drupal\Core\Layout\LayoutDefault
13 class LayoutDefaultTest extends UnitTestCase {
17 * @dataProvider providerTestBuild
19 public function testBuild($regions, $expected) {
20 $definition = new LayoutDefinition([
21 'theme_hook' => 'layout',
22 'library' => 'core/drupal',
34 '#layout' => $definition,
43 $layout = new LayoutDefault([], '', $definition);
44 $this->assertSame($expected, $layout->build($regions));
48 * Provides test data for ::testBuild().
50 public function providerTestBuild() {
52 // Empty regions are not added.
53 $data['right_only'] = [
65 // Regions will be in the order defined by the layout.
66 $data['switched_order'] = [