function ModerationInformationTest::getEntityTypeManager

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

Returns a mock Entity Type Manager.

Return value

\Drupal\Core\Entity\EntityTypeManagerInterface The mocked entity type manager.

3 calls to ModerationInformationTest::getEntityTypeManager()
ModerationInformationTest::testIsModeratedEntity in core/modules/content_moderation/tests/src/Unit/ModerationInformationTest.php
Tests is moderated entity.
ModerationInformationTest::testIsModeratedEntityType in core/modules/content_moderation/tests/src/Unit/ModerationInformationTest.php
Tests is moderated entity type.
ModerationInformationTest::testShouldModerateEntities in core/modules/content_moderation/tests/src/Unit/ModerationInformationTest.php
Tests should moderate entities.

File

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

Class

ModerationInformationTest
Tests Drupal\content_moderation\ModerationInformation.

Namespace

Drupal\Tests\content_moderation\Unit

Code

protected function getEntityTypeManager() {
  $entity_type_manager = $this->prophesize(EntityTypeManagerInterface::class);
  $entity_type_manager->getHandler(Argument::any(), 'moderation')
    ->willReturn(new ModerationHandler());
  return $entity_type_manager->reveal();
}

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