function LayoutBuilderTranslationTest::setUpEntities
Setup translated entity with layouts.
1 call to LayoutBuilderTranslationTest::setUpEntities()
- LayoutBuilderTranslationTest::setUp in core/modules/ layout_builder/ tests/ src/ Functional/ LayoutBuilderTranslationTest.php 
File
- 
              core/modules/ layout_builder/ tests/ src/ Functional/ LayoutBuilderTranslationTest.php, line 139 
Class
- LayoutBuilderTranslationTest
- Tests that the Layout Builder works with translated content.
Namespace
Drupal\Tests\layout_builder\FunctionalCode
protected function setUpEntities() {
  $this->drupalLogin($this->administrator);
  // @todo The Layout Builder UI relies on local tasks; fix in
  //   https://www.drupal.org/project/drupal/issues/2917777.
  $this->drupalPlaceBlock('local_tasks_block');
  // Create a test entity.
  $id = $this->createEntity([
    $this->fieldName => [
      [
        'value' => 'The untranslated field value',
      ],
    ],
    'name' => 'Test entity',
  ], $this->langcodes[0]);
  $storage = $this->container
    ->get('entity_type.manager')
    ->getStorage($this->entityTypeId);
  $storage->resetCache([
    $id,
  ]);
  $this->entity = $storage->load($id);
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
