You are here

protected function StateTransitionValidationTest::setupEntityTypeManager in Workbench Moderation 8.2

Same name and namespace in other branches
  1. 8 tests/src/Unit/StateTransitionValidationTest.php \Drupal\Tests\workbench_moderation\Unit\StateTransitionValidationTest::setupEntityTypeManager()

Builds a mocked Entity Type Manager.

Return value

EntityTypeManagerInterface

3 calls to StateTransitionValidationTest::setupEntityTypeManager()
StateTransitionValidationTest::testIsTransitionAllowedWithInValidTransition in tests/src/Unit/StateTransitionValidationTest.php
@covers ::isTransitionAllowed @covers ::calculatePossibleTransitions
StateTransitionValidationTest::testIsTransitionAllowedWithValidTransition in tests/src/Unit/StateTransitionValidationTest.php
@covers ::isTransitionAllowed @covers ::calculatePossibleTransitions
StateTransitionValidationTest::testUserSensitiveValidTransitions in tests/src/Unit/StateTransitionValidationTest.php
Verifies user-aware transition validation.

File

tests/src/Unit/StateTransitionValidationTest.php, line 135

Class

StateTransitionValidationTest
@coversDefaultClass \Drupal\workbench_moderation\StateTransitionValidation @group workbench_moderation

Namespace

Drupal\Tests\workbench_moderation\Unit

Code

protected function setupEntityTypeManager() {
  $entityTypeManager = $this
    ->prophesize(EntityTypeManagerInterface::class);
  $entityTypeManager
    ->getStorage('moderation_state')
    ->willReturn($this
    ->setupStateStorage());
  $entityTypeManager
    ->getStorage('moderation_state_transition')
    ->willReturn($this
    ->setupTransitionStorage());
  return $entityTypeManager
    ->reveal();
}