You are here

public function ModerationInformationTest::setupModerationEntityManager in Workbench Moderation 8.2

Same name and namespace in other branches
  1. 8 tests/src/Unit/ModerationInformationTest.php \Drupal\Tests\workbench_moderation\Unit\ModerationInformationTest::setupModerationEntityManager()
4 calls to ModerationInformationTest::setupModerationEntityManager()
ModerationInformationTest::testIsModeratableBundle in tests/src/Unit/ModerationInformationTest.php
@dataProvider providerBoolean @covers ::isModeratableBundle
ModerationInformationTest::testIsModeratableEntity in tests/src/Unit/ModerationInformationTest.php
@dataProvider providerBoolean @covers ::isModeratableEntity
ModerationInformationTest::testIsModeratedEntityForm in tests/src/Unit/ModerationInformationTest.php
@dataProvider providerBoolean @covers ::isModeratedEntityForm
ModerationInformationTest::testIsModeratedEntityFormWithNonContentEntityForm in tests/src/Unit/ModerationInformationTest.php

File

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

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());
}