protected function ViewsModerationStateSortTest::setUp in Drupal 10
Same name and namespace in other branches
- 8 core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateSortTest.php \Drupal\Tests\content_moderation\Kernel\ViewsModerationStateSortTest::setUp()
- 9 core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateSortTest.php \Drupal\Tests\content_moderation\Kernel\ViewsModerationStateSortTest::setUp()
File
- core/
modules/ content_moderation/ tests/ src/ Kernel/ ViewsModerationStateSortTest.php, line 38
Class
- ViewsModerationStateSortTest
- Tests the views moderation_state field sorting integration.
Namespace
Drupal\Tests\content_moderation\KernelCode
protected function setUp($import_test_views = TRUE) : void {
parent::setUp(FALSE);
$this
->installEntitySchema('user');
$this
->installEntitySchema('node');
$this
->installEntitySchema('content_moderation_state');
$this
->installEntitySchema('entity_test_no_bundle');
$this
->installSchema('node', 'node_access');
$this
->installConfig('content_moderation');
$node_type = NodeType::create([
'type' => 'example',
]);
$node_type
->save();
ConfigurableLanguage::createFromLangcode('fr')
->save();
$workflow = $this
->createEditorialWorkflow();
$workflow
->getTypePlugin()
->addState('zz_draft', 'ZZ Draft');
$workflow
->getTypePlugin()
->addState('aa_draft', 'AA Draft');
$workflow
->getTypePlugin()
->addEntityTypeAndBundle('node', 'example');
$workflow
->save();
}