You are here

private function LayoutBuilderTest::enableLayoutsForBundle in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderTest::enableLayoutsForBundle()
  2. 10 core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderTest::enableLayoutsForBundle()

Enable layouts.

Parameters

string $path: The path for the manage display page.

bool $allow_custom: Whether to allow custom layouts.

1 call to LayoutBuilderTest::enableLayoutsForBundle()
LayoutBuilderTest::testLayoutBuilderUi in core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php
Tests the Layout Builder UI.

File

core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php, line 431

Class

LayoutBuilderTest
Tests the Layout Builder UI.

Namespace

Drupal\Tests\layout_builder\FunctionalJavascript

Code

private function enableLayoutsForBundle($path, $allow_custom = FALSE) {
  $assert_session = $this
    ->assertSession();
  $page = $this
    ->getSession()
    ->getPage();
  $this
    ->drupalGet($path);
  $page
    ->checkField('layout[enabled]');
  if ($allow_custom) {
    $this
      ->assertNotEmpty($assert_session
      ->waitForElementVisible('css', 'input[name="layout[allow_custom]"]'));
    $page
      ->checkField('layout[allow_custom]');
  }
  $page
    ->pressButton('Save');
  $this
    ->assertNotEmpty($assert_session
    ->waitForElementVisible('css', '#edit-manage-layout'));
  $assert_session
    ->linkExists('Manage layout');
}