function ModerationInformationTest::setUp

Same name and namespace in other branches
  1. 9 core/modules/content_moderation/tests/src/Kernel/ModerationInformationTest.php \Drupal\Tests\content_moderation\Kernel\ModerationInformationTest::setUp()
  2. 8.9.x core/modules/content_moderation/tests/src/Kernel/ModerationInformationTest.php \Drupal\Tests\content_moderation\Kernel\ModerationInformationTest::setUp()
  3. 10 core/modules/content_moderation/tests/src/Kernel/ModerationInformationTest.php \Drupal\Tests\content_moderation\Kernel\ModerationInformationTest::setUp()

Overrides KernelTestBase::setUp

File

core/modules/content_moderation/tests/src/Kernel/ModerationInformationTest.php, line 43

Class

ModerationInformationTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21content_moderation%21src%21ModerationInformation.php/class/ModerationInformation/11.x" title="General service for moderation-related questions about Entity API." class="local">\Drupal\content_moderation\ModerationInformation</a> @group content_moderation

Namespace

Drupal\Tests\content_moderation\Kernel

Code

protected function setUp() : void {
    parent::setUp();
    $this->installEntitySchema('entity_test_rev');
    $this->installEntitySchema('entity_test_mulrevpub');
    $this->installEntitySchema('content_moderation_state');
    $this->installConfig([
        'content_moderation',
    ]);
    $this->moderationInformation = $this->container
        ->get('content_moderation.moderation_information');
    ConfigurableLanguage::createFromLangcode('de')->save();
    $workflow = $this->createEditorialWorkflow();
    $workflow->getTypePlugin()
        ->addEntityTypeAndBundle('entity_test_mulrevpub', 'entity_test_mulrevpub');
    $workflow->getTypePlugin()
        ->addEntityTypeAndBundle('entity_test_rev', 'entity_test_rev');
    $workflow->save();
    $this->container
        ->get('content_translation.manager')
        ->setEnabled('entity_test_mulrevpub', 'entity_test_mulrevpub', TRUE);
}

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