public function ContentModerationWorkflowTypeApiTest::testGetBundlesForEntityType in Drupal 9
Same name and namespace in other branches
- 8 core/modules/content_moderation/tests/src/Kernel/ContentModerationWorkflowTypeApiTest.php \Drupal\Tests\content_moderation\Kernel\ContentModerationWorkflowTypeApiTest::testGetBundlesForEntityType()
@covers ::getBundlesForEntityType @covers ::addEntityTypeAndBundle @covers ::removeEntityTypeAndBundle
File
- core/
modules/ content_moderation/ tests/ src/ Kernel/ ContentModerationWorkflowTypeApiTest.php, line 47
Class
- ContentModerationWorkflowTypeApiTest
- Tests the API of the ContentModeration workflow type plugin.
Namespace
Drupal\Tests\content_moderation\KernelCode
public function testGetBundlesForEntityType() {
/** @var \Drupal\content_moderation\Plugin\WorkflowType\ContentModeration $workflow_plugin */
$workflow_plugin = $this->workflow
->getTypePlugin();
// The content moderation plugin does not validate the existence of the
// entity type or bundle.
$this
->assertEquals([], $workflow_plugin
->getBundlesForEntityType('fake_node'));
$workflow_plugin
->addEntityTypeAndBundle('fake_node', 'fake_page');
$this
->assertEquals([
'fake_page',
], $workflow_plugin
->getBundlesForEntityType('fake_node'));
$this
->assertEquals([], $workflow_plugin
->getBundlesForEntityType('fake_block'));
$workflow_plugin
->removeEntityTypeAndBundle('fake_node', 'fake_page');
$this
->assertEquals([], $workflow_plugin
->getBundlesForEntityType('fake_node'));
}