function ModerationStateFieldItemListTest::setUp

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

Overrides KernelTestBase::setUp

File

core/modules/content_moderation/tests/src/Kernel/ModerationStateFieldItemListTest.php, line 43

Class

ModerationStateFieldItemListTest
@coversDefaultClass \Drupal\content_moderation\Plugin\Field\ModerationStateFieldItemList

Namespace

Drupal\Tests\content_moderation\Kernel

Code

protected function setUp() : void {
    parent::setUp();
    $this->installSchema('node', 'node_access');
    $this->installSchema('system', 'sequences');
    $this->installEntitySchema('node');
    $this->installEntitySchema('user');
    $this->installEntitySchema('content_moderation_state');
    $this->installConfig('content_moderation');
    NodeType::create([
        'type' => 'unmoderated',
    ])->save();
    $node_type = NodeType::create([
        'type' => 'example',
    ]);
    $node_type->save();
    $workflow = $this->createEditorialWorkflow();
    $workflow->getTypePlugin()
        ->addEntityTypeAndBundle('node', 'example');
    $workflow->save();
    $this->testNode = Node::create([
        'type' => 'example',
        'title' => 'Test title',
    ]);
    $this->testNode
        ->save();
    \Drupal::entityTypeManager()->getStorage('node')
        ->resetCache();
    $this->testNode = Node::load($this->testNode
        ->id());
    ConfigurableLanguage::createFromLangcode('de')->save();
}

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