function EnableLayoutBuilderTrait::enableLayoutBuilder

Same name in other branches
  1. 11.x core/modules/layout_builder/tests/src/Traits/EnableLayoutBuilderTrait.php \Drupal\Tests\layout_builder\Traits\EnableLayoutBuilderTrait::enableLayoutBuilder()

Enables Layout Builder on an entity view display.

Parameters

\Drupal\layout_builder\Entity\LayoutEntityDisplayInterface $display: The entity view display.

6 calls to EnableLayoutBuilderTrait::enableLayoutBuilder()
LayoutBuilderOverridesEditingThemeTest::testEditing in core/modules/layout_builder/tests/src/Functional/LayoutBuilderOverridesEditingThemeTest.php
Tests editing block content with Layout Builder.
LayoutBuilderTest::testFormAlter in core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php
Tests that hook_form_alter() has access to the Layout Builder info.
LayoutBuilderTest::testSectionLabels in core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php
Tests the functionality of custom section labels.
LayoutBuilderViewModeTest::testFullViewModeMultipleBundles in core/modules/layout_builder/tests/src/Functional/LayoutBuilderViewModeTest.php
Ensures that one bundle doesn't interfere with another bundle.
LayoutBuilderViewModeTest::testNonDefaultViewMode in core/modules/layout_builder/tests/src/Functional/LayoutBuilderViewModeTest.php
Tests that a non-default view mode works as expected.

... See full list

File

core/modules/layout_builder/tests/src/Traits/EnableLayoutBuilderTrait.php, line 20

Class

EnableLayoutBuilderTrait
Test trait to enable or disable Layout Builder on an entity view display.

Namespace

Drupal\Tests\layout_builder\Traits

Code

protected function enableLayoutBuilder(LayoutEntityDisplayInterface $display) : void {
    $display->enableLayoutBuilder()
        ->setOverridable()
        ->save();
}

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