You are here

public function ModerationInformationTest::setupModerationEntityManager in Workbench Moderation 8

Same name and namespace in other branches
  1. 8.2 tests/src/Unit/ModerationInformationTest.php \Drupal\Tests\workbench_moderation\Unit\ModerationInformationTest::setupModerationEntityManager()

Setup moderation entity manager.

4 calls to ModerationInformationTest::setupModerationEntityManager()
ModerationInformationTest::testIsModeratableBundle in tests/src/Unit/ModerationInformationTest.php
Test moderatable bundle.
ModerationInformationTest::testIsModeratableEntity in tests/src/Unit/ModerationInformationTest.php
Test moderatable entity.
ModerationInformationTest::testIsModeratedEntityForm in tests/src/Unit/ModerationInformationTest.php
Test moderated entity form.
ModerationInformationTest::testIsModeratedEntityFormWithNonContentEntityForm in tests/src/Unit/ModerationInformationTest.php
Test if moderated entity form is with non content entity form.

File

tests/src/Unit/ModerationInformationTest.php, line 50

Class

ModerationInformationTest
@coversDefaultClass \Drupal\workbench_moderation\ModerationInformation @group workbench_moderation

Namespace

Drupal\Tests\workbench_moderation\Unit

Code

public function setupModerationEntityManager($status) {
  $bundle = $this
    ->prophesize(ConfigEntityInterface::class);
  $bundle
    ->getThirdPartySetting('workbench_moderation', 'enabled', FALSE)
    ->willReturn($status);
  $entity_storage = $this
    ->prophesize(EntityStorageInterface::class);
  $entity_storage
    ->load('test_bundle')
    ->willReturn($bundle
    ->reveal());
  return $this
    ->getEntityTypeManager($entity_storage
    ->reveal());
}