function ModerationStateAccessTest::setUp

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

Overrides BrowserTestBase::setUp

File

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

Class

ModerationStateAccessTest
Tests the view access control handler for moderation state entities.

Namespace

Drupal\Tests\content_moderation\Functional

Code

protected function setUp() : void {
    parent::setUp();
    $node_type = NodeType::create([
        'type' => 'test',
        'name' => 'Test',
    ]);
    $node_type->save();
    $workflow = $this->createEditorialWorkflow();
    $workflow->getTypePlugin()
        ->addEntityTypeAndBundle('node', 'test');
    $workflow->save();
    $this->container
        ->get('module_installer')
        ->install([
        'content_moderation_test_views',
    ]);
}

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