function WorkspaceContentTranslationTest::setUp

Same name in other branches
  1. 11.x core/modules/workspaces/tests/src/Kernel/WorkspaceContentTranslationTest.php \Drupal\Tests\workspaces\Kernel\WorkspaceContentTranslationTest::setUp()

Overrides KernelTestBase::setUp

File

core/modules/workspaces/tests/src/Kernel/WorkspaceContentTranslationTest.php, line 43

Class

WorkspaceContentTranslationTest
Tests entity translations with workspaces.

Namespace

Drupal\Tests\workspaces\Kernel

Code

protected function setUp() : void {
    parent::setUp();
    $this->entityTypeManager = \Drupal::entityTypeManager();
    $this->installEntitySchema('entity_test_mulrevpub');
    $this->installEntitySchema('user');
    $this->installEntitySchema('workspace');
    $this->installConfig([
        'language',
        'content_translation',
    ]);
    $this->installSchema('workspaces', [
        'workspace_association',
    ]);
    $language = ConfigurableLanguage::createFromLangcode('ro');
    $language->save();
    $this->container
        ->get('content_translation.manager')
        ->setEnabled('entity_test_mulrevpub', 'entity_test_mulrevpub', TRUE);
    Workspace::create([
        'id' => 'stage',
        'label' => 'Stage',
    ])->save();
}

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