public function StateTransitionValidationTest::testIsTransitionAllowedWithValidTransition in Workbench Moderation 8
Same name and namespace in other branches
- 8.2 tests/src/Unit/StateTransitionValidationTest.php \Drupal\Tests\workbench_moderation\Unit\StateTransitionValidationTest::testIsTransitionAllowedWithValidTransition()
@covers ::isTransitionAllowed @covers ::calculatePossibleTransitions
File
- tests/
src/ Unit/ StateTransitionValidationTest.php, line 151
Class
- StateTransitionValidationTest
- @coversDefaultClass \Drupal\workbench_moderation\StateTransitionValidation @group workbench_moderation
Namespace
Drupal\Tests\workbench_moderation\UnitCode
public function testIsTransitionAllowedWithValidTransition() {
$state_transition_validation = new StateTransitionValidation($this
->setupEntityTypeManager());
$this
->assertTrue($state_transition_validation
->isTransitionAllowed('draft', 'draft'));
$this
->assertTrue($state_transition_validation
->isTransitionAllowed('draft', 'needs_review'));
$this
->assertTrue($state_transition_validation
->isTransitionAllowed('needs_review', 'needs_review'));
$this
->assertTrue($state_transition_validation
->isTransitionAllowed('needs_review', 'staging'));
$this
->assertTrue($state_transition_validation
->isTransitionAllowed('staging', 'published'));
$this
->assertTrue($state_transition_validation
->isTransitionAllowed('needs_review', 'draft'));
}