function it_provide_sm_getPossibleTransitions_function(FactoryInterface $factory, StateMachineInterface $stateMachine) { $this->getPossibleTransitions($object = new DummyObject(), 'simple'); $factory->get($object, 'simple')->shouldHaveBeenCalled(); $stateMachine->getPossibleTransitions()->shouldHaveBeenCalled(); }
function let(StateMachineInterface $stateMachine) { $stateMachine->getGraph()->willReturn('checkout_state_machine'); $stateMachine->getPossibleTransitions()->willReturn(['start', 'abandon']); $this->beConstructedWith('start_checkout', $stateMachine); }
/** * @param string $transition * @param StateMachineInterface $stateMachine */ public function __construct($transition, StateMachineInterface $stateMachine) { parent::__construct(sprintf('Transition "%s" is invalid for "%s" state machine. Possible transitions are: %s.', $transition, $stateMachine->getGraph(), implode($stateMachine->getPossibleTransitions(), ' and '))); }