function ModerationActionsTest::setUp

Same name in other branches
  1. 9 core/modules/content_moderation/tests/src/Functional/ModerationActionsTest.php \Drupal\Tests\content_moderation\Functional\ModerationActionsTest::setUp()
  2. 10 core/modules/content_moderation/tests/src/Functional/ModerationActionsTest.php \Drupal\Tests\content_moderation\Functional\ModerationActionsTest::setUp()
  3. 11.x core/modules/content_moderation/tests/src/Functional/ModerationActionsTest.php \Drupal\Tests\content_moderation\Functional\ModerationActionsTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/content_moderation/tests/src/Functional/ModerationActionsTest.php, line 39

Class

ModerationActionsTest
Test the content moderation actions.

Namespace

Drupal\Tests\content_moderation\Functional

Code

public function setUp() {
    parent::setUp();
    $moderated_bundle = $this->createContentType([
        'type' => 'moderated_bundle',
    ]);
    $moderated_bundle->save();
    $standard_bundle = $this->createContentType([
        'type' => 'standard_bundle',
    ]);
    $standard_bundle->save();
    $workflow = $this->createEditorialWorkflow();
    $workflow->getTypePlugin()
        ->addEntityTypeAndBundle('node', 'moderated_bundle');
    $workflow->save();
    $admin = $this->drupalCreateUser([
        'access content overview',
        'administer nodes',
        'bypass node access',
    ]);
    $this->drupalLogin($admin);
}

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