You are here

protected function ContentModerationTestTrait::addEntityTypeAndBundleToWorkflow in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/content_moderation/tests/src/Traits/ContentModerationTestTrait.php \Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait::addEntityTypeAndBundleToWorkflow()
  2. 9 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.

File

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

Class

ContentModerationTestTrait
Provides functionality for testing content moderation.

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();
}