You are here

public function LayoutBuilderEntityViewDisplayTest::testIsLayoutBuilderEnabled in Drupal 9

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

@dataProvider providerTestIsLayoutBuilderEnabled

File

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

Class

LayoutBuilderEntityViewDisplayTest
@coversDefaultClass \Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay

Namespace

Drupal\Tests\layout_builder\Kernel

Code

public function testIsLayoutBuilderEnabled($expected, $view_mode, $enabled) {
  $display = LayoutBuilderEntityViewDisplay::create([
    'targetEntityType' => 'entity_test',
    'bundle' => 'entity_test',
    'mode' => $view_mode,
    'status' => TRUE,
    'third_party_settings' => [
      'layout_builder' => [
        'enabled' => $enabled,
      ],
    ],
  ]);
  $result = $display
    ->isLayoutBuilderEnabled();
  $this
    ->assertSame($expected, $result);
}