You are here

public function ModerationRevisionRevertTest::setUp in Drupal 8

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

Overrides BrowserTestBase::setUp

File

core/modules/content_moderation/tests/src/Functional/ModerationRevisionRevertTest.php, line 37

Class

ModerationRevisionRevertTest
Test revision revert.

Namespace

Drupal\Tests\content_moderation\Functional

Code

public function setUp() {
  parent::setUp();
  $moderated_bundle = $this
    ->createContentType([
    'type' => 'moderated_bundle',
  ]);
  $moderated_bundle
    ->save();
  $workflow = $this
    ->createEditorialWorkflow();
  $workflow
    ->getTypePlugin()
    ->addEntityTypeAndBundle('node', 'moderated_bundle');
  $workflow
    ->save();

  /** @var \Drupal\Core\Routing\RouteBuilderInterface $router_builder */
  $router_builder = $this->container
    ->get('router.builder');
  $router_builder
    ->rebuildIfNeeded();
  $admin = $this
    ->drupalCreateUser([
    'access content overview',
    'administer nodes',
    'bypass node access',
    'view all revisions',
    'use editorial transition create_new_draft',
    'use editorial transition publish',
  ]);
  $this
    ->drupalLogin($admin);
}