You are here

protected function ContentModerationTestTrait::addEntityTypeAndBundleToWorkflow in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/content_moderation/tests/src/Traits/ContentModerationTestTrait.php \Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait::addEntityTypeAndBundleToWorkflow()
  2. 10 core/modules/content_moderation/tests/src/Traits/ContentModerationTestTrait.php \Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait::addEntityTypeAndBundleToWorkflow()

Adds an entity type ID / bundle ID to the given workflow.

Parameters

\Drupal\workflows\WorkflowInterface $workflow: A workflow object.

string $entity_type_id: The entity type ID to add.

string $bundle: The bundle ID to add.

9 calls to ContentModerationTestTrait::addEntityTypeAndBundleToWorkflow()
ContentModerationStateTest::testChangingContentLangcode in core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php
Test changing the language of content without adding a translation.
ContentModerationStateTest::testExistingContentModerationStateDataRemoval in core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php
Tests removal of content moderation state entities for preexisting content.
ContentModerationStateTest::testModerationWithFieldConfigOverride in core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php
Tests moderation when the moderation_state field has a config override.
ContentModerationStateTest::testModerationWithSpecialLanguages in core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php
Tests that entities with special languages can be moderated.
ContentModerationStateTest::testMultilingualModeration in core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php
Tests basic multilingual content moderation through the API.

... See full list

1 method overrides ContentModerationTestTrait::addEntityTypeAndBundleToWorkflow()
WorkspacesContentModerationStateTest::addEntityTypeAndBundleToWorkflow in core/modules/content_moderation/tests/src/Kernel/WorkspacesContentModerationStateTest.php
Adds an entity type ID / bundle ID to the given workflow.

File

core/modules/content_moderation/tests/src/Traits/ContentModerationTestTrait.php, line 99

Class

ContentModerationTestTrait
Trait ContentModerationTestTraint.

Namespace

Drupal\Tests\content_moderation\Traits

Code

protected function addEntityTypeAndBundleToWorkflow(WorkflowInterface $workflow, $entity_type_id, $bundle) {
  $workflow
    ->getTypePlugin()
    ->addEntityTypeAndBundle($entity_type_id, $bundle);
  $workflow
    ->save();
}