You are here

protected function LayoutSectionTest::createSectionNode in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/tests/src/Functional/LayoutSectionTest.php \Drupal\Tests\layout_builder\Functional\LayoutSectionTest::createSectionNode()

Creates a node with a section field.

Parameters

array $section_values: An array of values for a section field.

Return value

\Drupal\node\NodeInterface The node object.

3 calls to LayoutSectionTest::createSectionNode()
LayoutSectionTest::testLayoutPageTitle in core/modules/layout_builder/tests/src/Functional/LayoutSectionTest.php
Ensures that the entity title is displayed.
LayoutSectionTest::testLayoutSectionFormatter in core/modules/layout_builder/tests/src/Functional/LayoutSectionTest.php
Tests layout_section formatter output.
LayoutSectionTest::testLayoutSectionFormatterAccess in core/modules/layout_builder/tests/src/Functional/LayoutSectionTest.php
Tests the access checking of the section formatter.

File

core/modules/layout_builder/tests/src/Functional/LayoutSectionTest.php, line 327

Class

LayoutSectionTest
Tests the rendering of a layout section field.

Namespace

Drupal\Tests\layout_builder\Functional

Code

protected function createSectionNode(array $section_values) {
  return $this
    ->createNode([
    'type' => 'bundle_with_section_field',
    'title' => 'The node title',
    'body' => [
      [
        'value' => 'The node body',
      ],
    ],
    OverridesSectionStorage::FIELD_NAME => $section_values,
  ]);
}