You are here

public function ModeratedContentViewTest::setUp in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/content_moderation/tests/src/Functional/ModeratedContentViewTest.php \Drupal\Tests\content_moderation\Functional\ModeratedContentViewTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/content_moderation/tests/src/Functional/ModeratedContentViewTest.php, line 45

Class

ModeratedContentViewTest
Tests moderated content administration page functionality.

Namespace

Drupal\Tests\content_moderation\Functional

Code

public function setUp() : void {
  parent::setUp();
  $this
    ->drupalCreateContentType([
    'type' => 'page',
    'name' => 'Basic page',
  ])
    ->save();
  $this
    ->drupalCreateContentType([
    'type' => 'article',
    'name' => 'Article',
  ])
    ->save();
  $this
    ->drupalCreateContentType([
    'type' => 'unmoderated_type',
    'name' => 'Unmoderated type',
  ])
    ->save();
  $workflow = $this
    ->createEditorialWorkflow();
  $workflow
    ->getTypePlugin()
    ->addEntityTypeAndBundle('node', 'page');
  $workflow
    ->getTypePlugin()
    ->addEntityTypeAndBundle('node', 'article');
  $workflow
    ->save();
  $this->adminUser = $this
    ->drupalCreateUser([
    'access administration pages',
    'view any unpublished content',
    'administer nodes',
    'bypass node access',
  ]);
}