function LayoutBuilderCompatibilityTestBase::installLayoutBuilder

Same name and namespace in other branches
  1. 11.x core/modules/layout_builder/tests/src/Kernel/LayoutBuilderCompatibilityTestBase.php \Drupal\Tests\layout_builder\Kernel\LayoutBuilderCompatibilityTestBase::installLayoutBuilder()

Installs the Layout Builder.

Also configures and reloads the entity display.

File

core/modules/layout_builder/tests/src/Kernel/LayoutBuilderCompatibilityTestBase.php, line 90

Class

LayoutBuilderCompatibilityTestBase
Tests Layout Builder's compatibility with existing systems.

Namespace

Drupal\Tests\layout_builder\Kernel

Code

protected function installLayoutBuilder() {
  $this->container
    ->get('module_installer')
    ->install([
    'layout_builder',
  ]);
  $this->refreshServices();
  $this->display = $this->reloadEntity($this->display);
  $this->display
    ->enableLayoutBuilder()
    ->save();
  $this->entity = $this->reloadEntity($this->entity);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.