/**
* @covers ::deleteTransition
*/
public function testDeleteTransition() { $workflow_type =
new TestType([], '',
[]);
$workflow_type ->
addState('draft', 'Draft'
) ->
addState('published', 'Published'
) ->
addTransition('create_new_draft', 'Create new draft',
['draft'
], 'draft'
) ->
addTransition('publish', 'Publish',
['draft'
], 'published'
);
$this->
assertTrue($workflow_type->
getState('draft'
)->
canTransitionTo('published'
));
$workflow_type->
deleteTransition('publish'
);
$this->
assertFalse($workflow_type->
getState('draft'
)->
canTransitionTo('published'
));
$this->
assertTrue($workflow_type->
getState('draft'
)->
canTransitionTo('draft'
));
} /**
* @covers ::deleteTransition
*/
public function testDeleteTransitionException() { $this->
expectException(\InvalidArgumentException::
class);
$this->
expectExceptionMessage("The transition 'draft-published' does not exist in workflow."
);
$workflow =
new Workflow(['id' => 'test', 'type' => 'test_type'
], 'workflow'
);