protected function ModerationStateFieldItemListTest::setUp in Drupal 10
Same name and namespace in other branches
- 8 core/modules/content_moderation/tests/src/Kernel/ModerationStateFieldItemListTest.php \Drupal\Tests\content_moderation\Kernel\ModerationStateFieldItemListTest::setUp()
- 9 core/modules/content_moderation/tests/src/Kernel/ModerationStateFieldItemListTest.php \Drupal\Tests\content_moderation\Kernel\ModerationStateFieldItemListTest::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\KernelCode
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();
}