function WorkspacesContentModerationStateTest::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.

Overrides ContentModerationTestTrait::addEntityTypeAndBundleToWorkflow

2 calls to WorkspacesContentModerationStateTest::addEntityTypeAndBundleToWorkflow()
WorkspacesContentModerationStateTest::testContentModerationIntegrationWithWorkspaces in core/modules/content_moderation/tests/src/Kernel/WorkspacesContentModerationStateTest.php
Tests the integration between Content Moderation and Workspaces.
WorkspacesContentModerationStateTest::testContentModerationMultipleEntityTypesWithWorkspaces in core/modules/content_moderation/tests/src/Kernel/WorkspacesContentModerationStateTest.php
Publish a workspace with multiple entities from different entity types.

File

core/modules/content_moderation/tests/src/Kernel/WorkspacesContentModerationStateTest.php, line 349

Class

WorkspacesContentModerationStateTest
Tests that Workspaces and Content Moderation work together properly.

Namespace

Drupal\Tests\content_moderation\Kernel

Code

protected function addEntityTypeAndBundleToWorkflow(WorkflowInterface $workflow, $entity_type_id, $bundle) {
  $this->workspaceManager
    ->executeOutsideWorkspace(function () use ($workflow, $entity_type_id, $bundle) {
    $this->traitAddEntityTypeAndBundleToWorkflow($workflow, $entity_type_id, $bundle);
  });
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.