/**
* @covers ::getTransitionTo
*/
public function testGetTransitionTo() { $workflow_type =
new TestType([], '',
[]);
$workflow_type ->
addState('draft', 'Draft'
) ->
addState('published', 'Published'
) ->
addTransition('publish', 'Publish',
['draft'
], 'published'
);
$state =
$workflow_type->
getState('draft'
);
$transition =
$state->
getTransitionTo('published'
);
$this->
assertEquals('Publish',
$transition->
label());
} /**
* @covers ::getTransitionTo
*/
public function testGetTransitionToException() { $this->
expectException(\InvalidArgumentException::
class);
$this->
expectExceptionMessage("Can not transition to 'published' state"
);
$workflow_type =
new TestType([], '',
[]);
$workflow_type->
addState('draft', 'Draft'
);