function LayoutBuilderTranslationTest::setUpViewDisplay

Same name in other branches
  1. 9 core/modules/layout_builder/tests/src/Functional/LayoutBuilderTranslationTest.php \Drupal\Tests\layout_builder\Functional\LayoutBuilderTranslationTest::setUpViewDisplay()
  2. 8.9.x core/modules/layout_builder/tests/src/Functional/LayoutBuilderTranslationTest.php \Drupal\Tests\layout_builder\Functional\LayoutBuilderTranslationTest::setUpViewDisplay()
  3. 11.x core/modules/layout_builder/tests/src/Functional/LayoutBuilderTranslationTest.php \Drupal\Tests\layout_builder\Functional\LayoutBuilderTranslationTest::setUpViewDisplay()

Set up the View Display.

1 call to LayoutBuilderTranslationTest::setUpViewDisplay()
LayoutBuilderTranslationTest::setUp in core/modules/layout_builder/tests/src/Functional/LayoutBuilderTranslationTest.php

File

core/modules/layout_builder/tests/src/Functional/LayoutBuilderTranslationTest.php, line 163

Class

LayoutBuilderTranslationTest
Tests that the Layout Builder works with translated content.

Namespace

Drupal\Tests\layout_builder\Functional

Code

protected function setUpViewDisplay() {
    EntityViewDisplay::create([
        'targetEntityType' => $this->entityTypeId,
        'bundle' => $this->bundle,
        'mode' => 'default',
        'status' => TRUE,
    ])
        ->setComponent($this->fieldName, [
        'type' => 'string',
    ])
        ->enableLayoutBuilder()
        ->setOverridable()
        ->save();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.