You are here

public function ContentEntityLinkTest::setUp in Translation Management Tool 8

Overrides ContentEntityTestBase::setUp

File

sources/content/tests/src/Kernel/ContentEntityLinkTest.php, line 33

Class

ContentEntityLinkTest
Tests for the link integration.

Namespace

Drupal\Tests\tmgmt_content\Kernel

Code

public function setUp() : void {
  parent::setUp();
  $field_storage = FieldStorageConfig::create([
    'field_name' => 'link',
    'entity_type' => $this->entityTypeId,
    'type' => 'link',
    'cardinality' => 1,
    'translatable' => TRUE,
  ]);
  $field_storage
    ->save();
  FieldConfig::create([
    'entity_type' => $this->entityTypeId,
    'field_storage' => $field_storage,
    'bundle' => $this->entityTypeId,
    'label' => 'Link',
  ])
    ->save();
  $this->container
    ->get('content_translation.manager')
    ->setEnabled($this->entityTypeId, $this->entityTypeId, TRUE);
}