You are here

public function LayoutTest::renderLayoutData in Layout Plugin (obsolete, use core's Layout Discovery) 8

Data provider for testRenderLayout().

File

tests/src/Kernel/LayoutTest.php, line 63

Class

LayoutTest
Tests Layout functionality.

Namespace

Drupal\Tests\layout_plugin\Kernel

Code

public function renderLayoutData() {
  $data = [
    'layout_test_1col' => [
      'layout_test_1col',
      [],
      [
        'top' => [
          '#markup' => 'This is the top',
        ],
        'bottom' => [
          '#markup' => 'This is the bottom',
        ],
      ],
    ],
    'layout_test_2col' => [
      'layout_test_2col',
      [],
      [
        'left' => [
          '#markup' => 'This is the left',
        ],
        'right' => [
          '#markup' => 'This is the right',
        ],
      ],
    ],
    'layout_test_plugin' => [
      'layout_test_plugin',
      [
        'setting_1' => 'Config value',
      ],
      [
        'main' => [
          '#markup' => 'Main region',
        ],
      ],
    ],
  ];
  $data['layout_test_1col'][] = <<<'EOD'
<div class="layout-example-1col clearfix">
  <div class="region-top">
    This is the top
  </div>
  <div class="region-bottom">
    This is the bottom
  </div>
</div>
EOD;
  $data['layout_test_2col'][] = <<<'EOD'
<div class="layout-example-2col clearfix">
  <div class="region-left">
    This is the left
  </div>
  <div class="region-right">
    This is the right
  </div>
</div>
EOD;
  $data['layout_test_plugin'][] = <<<'EOD'
<div class="layout-test-plugin clearfix">
  <div>
    <span class="setting-1-label">Blah: </span>
    Config value
  </div>
  <div class="region-main">
    Main region
  </div>
</div>
EOD;
  return $data;
}