You are here

public function ModerationActionsTest::setUp in Drupal 9

Same name and namespace in other branches
  1. 8 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() : void {
  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);
}