function WorkspacesContentModerationStateTest::testWorkspaceEntityTypeModeration

Same name in other branches
  1. 9 core/modules/content_moderation/tests/src/Kernel/WorkspacesContentModerationStateTest.php \Drupal\Tests\content_moderation\Kernel\WorkspacesContentModerationStateTest::testWorkspaceEntityTypeModeration()
  2. 11.x core/modules/content_moderation/tests/src/Kernel/WorkspacesContentModerationStateTest.php \Drupal\Tests\content_moderation\Kernel\WorkspacesContentModerationStateTest::testWorkspaceEntityTypeModeration()

Tests that the 'workspace' entity type can not be moderated.

See also

\Drupal\workspaces\EntityTypeInfo::entityTypeAlter()

File

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

Class

WorkspacesContentModerationStateTest
Tests that Workspaces and Content Moderation work together properly.

Namespace

Drupal\Tests\content_moderation\Kernel

Code

public function testWorkspaceEntityTypeModeration() : void {
    
    /** @var \Drupal\content_moderation\ModerationInformationInterface $moderation_info */
    $moderation_info = \Drupal::service('content_moderation.moderation_information');
    $entity_type = \Drupal::entityTypeManager()->getDefinition('workspace');
    $this->assertFalse($moderation_info->canModerateEntitiesOfEntityType($entity_type));
}

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