You are here

private function LayoutSelectionTest::enableLayoutBuilderForNodeType in Layout builder library 8

Enables Layout Builder for the default display of a node type.

Parameters

string $node_type: The node type ID.

1 call to LayoutSelectionTest::enableLayoutBuilderForNodeType()
LayoutSelectionTest::testReferenceableLayoutsFilteredByTargetBundle in tests/src/Functional/LayoutSelectionTest.php
Tests that reference-able layouts are filtered by target bundle.

File

tests/src/Functional/LayoutSelectionTest.php, line 91

Class

LayoutSelectionTest
Tests the functionality of the layout_selection field.

Namespace

Drupal\Tests\layout_library\Functional

Code

private function enableLayoutBuilderForNodeType($node_type) {
  $page = $this
    ->getSession()
    ->getPage();
  $assert = $this
    ->assertSession();
  $this
    ->drupalGet("/admin/structure/types/manage/{$node_type}/display");
  $page
    ->checkField('layout[enabled]');
  $page
    ->checkField('layout[library]');
  $page
    ->pressButton('Save');
  $assert
    ->pageTextContains('Your settings have been saved.');
}