You are here

public function StateTransitionValidationTest::testIsTransitionAllowedWithInValidTransition 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::testIsTransitionAllowedWithInValidTransition()

@covers ::isTransitionAllowed @covers ::calculatePossibleTransitions

File

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

Class

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

Namespace

Drupal\Tests\workbench_moderation\Unit

Code

public function testIsTransitionAllowedWithInValidTransition() {
  $state_transition_validation = new StateTransitionValidation($this
    ->setupEntityTypeManager(), $this
    ->setupQueryFactory());
  $this
    ->assertFalse($state_transition_validation
    ->isTransitionAllowed('published', 'needs_review'));
  $this
    ->assertFalse($state_transition_validation
    ->isTransitionAllowed('published', 'staging'));
  $this
    ->assertFalse($state_transition_validation
    ->isTransitionAllowed('staging', 'needs_review'));
  $this
    ->assertFalse($state_transition_validation
    ->isTransitionAllowed('staging', 'staging'));
  $this
    ->assertFalse($state_transition_validation
    ->isTransitionAllowed('needs_review', 'published'));
  $this
    ->assertFalse($state_transition_validation
    ->isTransitionAllowed('published', 'archived'));
  $this
    ->assertFalse($state_transition_validation
    ->isTransitionAllowed('archived', 'published'));
}