You are here

public function WorkspacesContentModerationStateTest::testWorkspaceEntityTypeModeration in Drupal 9

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 57

Class

WorkspacesContentModerationStateTest
Tests that Workspaces and Content Moderation work together properly.

Namespace

Drupal\Tests\content_moderation\Kernel

Code

public function testWorkspaceEntityTypeModeration() {

  /** @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));
}