function ContentModerationWorkflowConfigTest::setUp

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

Overrides KernelTestBase::setUp

File

core/modules/content_moderation/tests/src/Kernel/ContentModerationWorkflowConfigTest.php, line 55

Class

ContentModerationWorkflowConfigTest
Tests how Content Moderation handles workflow config changes.

Namespace

Drupal\Tests\content_moderation\Kernel

Code

protected function setUp() {
    parent::setUp();
    $this->installSchema('node', 'node_access');
    $this->installEntitySchema('node');
    $this->installEntitySchema('user');
    $this->installEntitySchema('content_moderation_state');
    $this->installConfig([
        'system',
        'content_moderation',
    ]);
    NodeType::create([
        'type' => 'example',
    ])->save();
    $workflow = $this->createEditorialWorkflow();
    $workflow->getTypePlugin()
        ->addState('test1', 'Test one')
        ->addState('test2', 'Test two')
        ->addState('test3', 'Test three')
        ->addEntityTypeAndBundle('node', 'example');
    $workflow->save();
    $this->workflow = $workflow;
    $this->copyConfig($this->container
        ->get('config.storage'), $this->container
        ->get('config.storage.sync'));
}

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