You are here

public function LayoutBuilderEntityViewDisplayTest::testSetOverridable in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/tests/src/Kernel/LayoutBuilderEntityViewDisplayTest.php \Drupal\Tests\layout_builder\Kernel\LayoutBuilderEntityViewDisplayTest::testSetOverridable()
  2. 9 core/modules/layout_builder/tests/src/Kernel/LayoutBuilderEntityViewDisplayTest.php \Drupal\Tests\layout_builder\Kernel\LayoutBuilderEntityViewDisplayTest::testSetOverridable()

Tests that setting overridable enables Layout Builder only when TRUE.

File

core/modules/layout_builder/tests/src/Kernel/LayoutBuilderEntityViewDisplayTest.php, line 80

Class

LayoutBuilderEntityViewDisplayTest
@coversDefaultClass \Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay

Namespace

Drupal\Tests\layout_builder\Kernel

Code

public function testSetOverridable() {

  // Disable Layout Builder.
  $this->sectionList
    ->disableLayoutBuilder();

  // Set Overridable to TRUE and ensure Layout Builder is enabled.
  $this->sectionList
    ->setOverridable();
  $this
    ->assertTrue($this->sectionList
    ->isLayoutBuilderEnabled());

  // Ensure Layout Builder is still enabled after setting Overridable to FALSE.
  $this->sectionList
    ->setOverridable(FALSE);
  $this
    ->assertTrue($this->sectionList
    ->isLayoutBuilderEnabled());
}