function ViewsModerationStateFilterTest::setUp
Same name in this branch
- 11.x core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateFilterTest.php \Drupal\Tests\content_moderation\Kernel\ViewsModerationStateFilterTest::setUp()
Same name in other branches
- 9 core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateFilterTest.php \Drupal\Tests\content_moderation\Kernel\ViewsModerationStateFilterTest::setUp()
- 9 core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php \Drupal\Tests\content_moderation\Functional\ViewsModerationStateFilterTest::setUp()
- 8.9.x core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateFilterTest.php \Drupal\Tests\content_moderation\Kernel\ViewsModerationStateFilterTest::setUp()
- 8.9.x core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php \Drupal\Tests\content_moderation\Functional\ViewsModerationStateFilterTest::setUp()
- 10 core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateFilterTest.php \Drupal\Tests\content_moderation\Kernel\ViewsModerationStateFilterTest::setUp()
- 10 core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php \Drupal\Tests\content_moderation\Functional\ViewsModerationStateFilterTest::setUp()
Overrides ViewTestBase::setUp
File
-
core/
modules/ content_moderation/ tests/ src/ Functional/ ViewsModerationStateFilterTest.php, line 47
Class
- ViewsModerationStateFilterTest
- Tests the views 'moderation_state_filter' filter plugin.
Namespace
Drupal\Tests\content_moderation\FunctionalCode
protected function setUp($import_test_views = TRUE, $modules = []) : void {
parent::setUp(FALSE, $modules);
$this->drupalCreateContentType([
'type' => 'example_a',
]);
$this->drupalCreateContentType([
'type' => 'example_b',
]);
$this->drupalCreateContentType([
'type' => 'example_c',
]);
$this->createEditorialWorkflow();
$new_workflow = Workflow::create([
'type' => 'content_moderation',
'id' => 'new_workflow',
'label' => 'New workflow',
]);
$new_workflow->getTypePlugin()
->addState('bar', 'Bar');
$new_workflow->getTypePlugin()
->addEntityTypeAndBundle('node', 'example_c');
$new_workflow->save();
$this->drupalLogin($this->drupalCreateUser([
'administer workflows',
'administer views',
]));
$this->container
->get('module_installer')
->install([
'content_moderation_test_views',
]);
$new_workflow->getTypePlugin()
->removeEntityTypeAndBundle('node', 'example_c');
$new_workflow->save();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.