function ModerationInformationTest::testIsModeratedEntityType

Same name and namespace in other branches
  1. 9 core/modules/content_moderation/tests/src/Unit/ModerationInformationTest.php \Drupal\Tests\content_moderation\Unit\ModerationInformationTest::testIsModeratedEntityType()
  2. 8.9.x core/modules/content_moderation/tests/src/Unit/ModerationInformationTest.php \Drupal\Tests\content_moderation\Unit\ModerationInformationTest::testIsModeratedEntityType()
  3. 11.x core/modules/content_moderation/tests/src/Unit/ModerationInformationTest.php \Drupal\Tests\content_moderation\Unit\ModerationInformationTest::testIsModeratedEntityType()

@covers ::isModeratedEntityType

File

core/modules/content_moderation/tests/src/Unit/ModerationInformationTest.php, line 74

Class

ModerationInformationTest
@coversDefaultClass \Drupal\content_moderation\ModerationInformation[[api-linebreak]] @group content_moderation

Namespace

Drupal\Tests\content_moderation\Unit

Code

public function testIsModeratedEntityType() : void {
  $moderation_information = new ModerationInformation($this->getEntityTypeManager(), $this->setupModerationBundleInfo('test_bundle', 'workflow'));
  $moderated_entity_type = $this->prophesize(EntityTypeInterface::class);
  $moderated_entity_type->id()
    ->willReturn('test_entity_type');
  $unmoderated_entity_type = $this->prophesize(EntityTypeInterface::class);
  $unmoderated_entity_type->id()
    ->willReturn('unmoderated_test_type');
  $this->assertTrue($moderation_information->isModeratedEntityType($moderated_entity_type->reveal()));
  $this->assertFalse($moderation_information->isModeratedEntityType($unmoderated_entity_type->reveal()));
}

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