You are here

protected function LayoutBuilderAtBase::createDefaultTranslationEntity in Layout Builder Asymmetric Translation 8.2

Create entity.

2 calls to LayoutBuilderAtBase::createDefaultTranslationEntity()
LayoutBuilderAtReplicateTest::testAsymmetricTranslationWithReplicate in tests/src/Functional/LayoutBuilderAtReplicateTest.php
Tests that layout overrides have copied blocks.
LayoutBuilderAtTranslationTest::testAsymmetricTranslation in tests/src/Functional/LayoutBuilderAtTranslationTest.php
Tests that layout overrides have different blocks.

File

tests/src/Functional/LayoutBuilderAtBase.php, line 142

Class

LayoutBuilderAtBase
Base class for Layout Builder Asymmetric Translations.

Namespace

Drupal\Tests\layout_builder_at\Functional

Code

protected function createDefaultTranslationEntity() {

  // Create a test entity.
  $id = $this
    ->createEntity([
    $this->fieldName => [
      [
        'value' => self::defaultTextFieldText,
      ],
    ],
  ], $this->langcodes[0]);
  $storage = $this->container
    ->get('entity_type.manager')
    ->getStorage($this->entityTypeId);
  $storage
    ->resetCache([
    $id,
  ]);
  $this->entity = $storage
    ->load($id);
}