function AddModerationConfigActionTest::testAddEntityTypeAndBundle
Same name in other branches
- 11.x core/modules/content_moderation/tests/src/Kernel/ConfigAction/AddModerationConfigActionTest.php \Drupal\Tests\content_moderation\Kernel\ConfigAction\AddModerationConfigActionTest::testAddEntityTypeAndBundle()
File
-
core/
modules/ content_moderation/ tests/ src/ Kernel/ ConfigAction/ AddModerationConfigActionTest.php, line 43
Class
- AddModerationConfigActionTest
- @covers \Drupal\content_moderation\Plugin\ConfigAction\AddModeration @covers \Drupal\content_moderation\Plugin\ConfigAction\AddModerationDeriver @group content_moderation @group Recipe
Namespace
Drupal\Tests\content_moderation\Kernel\ConfigActionCode
public function testAddEntityTypeAndBundle() : void {
$this->installConfig('node');
$this->createContentType([
'type' => 'a',
]);
$this->createContentType([
'type' => 'b',
]);
$this->createContentType([
'type' => 'c',
]);
$this->createVocabulary([
'vid' => 'tags',
]);
$recipe = $this->createRecipe('workflows.workflow.editorial');
RecipeRunner::processRecipe($recipe);
/** @var \Drupal\content_moderation\Plugin\WorkflowType\ContentModerationInterface $plugin */
$plugin = Workflow::load('editorial')?->getTypePlugin();
$this->assertSame([
'a',
'b',
], $plugin->getBundlesForEntityType('node'));
$this->assertSame([
'tags',
], $plugin->getBundlesForEntityType('taxonomy_term'));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.