function TaxonomyTermContentModerationTest::setUp

Same name in other branches
  1. 10 core/modules/taxonomy/tests/src/Functional/TaxonomyTermContentModerationTest.php \Drupal\Tests\taxonomy\Functional\TaxonomyTermContentModerationTest::setUp()

Overrides TaxonomyTestBase::setUp

File

core/modules/taxonomy/tests/src/Functional/TaxonomyTermContentModerationTest.php, line 41

Class

TaxonomyTermContentModerationTest
Tests taxonomy terms with Content Moderation.

Namespace

Drupal\Tests\taxonomy\Functional

Code

protected function setUp() : void {
    parent::setUp();
    $this->createEditorialWorkflow();
    $this->drupalLogin($this->drupalCreateUser([
        'administer taxonomy',
        'use editorial transition create_new_draft',
        'use editorial transition publish',
        'view any unpublished content',
        'view latest version',
    ]));
    $this->vocabulary = $this->createVocabulary();
    // Set the vocabulary as moderated.
    $workflow = Workflow::load('editorial');
    $workflow->getTypePlugin()
        ->addEntityTypeAndBundle('taxonomy_term', $this->vocabulary
        ->id());
    $workflow->save();
}

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