You are here

protected function DiffRevisionContentModerationTest::setUp in Diff 8

Overrides DiffTestBase::setUp

File

tests/src/Functional/DiffRevisionContentModerationTest.php, line 24

Class

DiffRevisionContentModerationTest
Tests the revision overview with content moderation enabled.

Namespace

Drupal\Tests\diff\Functional

Code

protected function setUp() {
  parent::setUp();

  // Enable moderation on articles.
  $this
    ->createEditorialWorkflow();

  /** @var \Drupal\workflows\WorkflowInterface $workflow */
  $workflow = Workflow::load('editorial');

  /** @var \Drupal\content_moderation\Plugin\WorkflowType\ContentModeration $plugin */
  $plugin = $workflow
    ->getTypePlugin();
  $plugin
    ->addEntityTypeAndBundle('node', 'article');
  $workflow
    ->save();

  // Add necessary admin permissions for moderated content.
  $this->adminPermissions = array_merge([
    'use editorial transition create_new_draft',
    'use editorial transition publish',
    'use editorial transition archive',
    'use editorial transition archived_draft',
    'use editorial transition archived_published',
    'view latest version',
    'view any unpublished content',
  ], $this->adminPermissions);
}