function it_loads(IssueInterface $issue, StatusInterface $status, StatusInterface $status2, StatusTransitionInterface $transition) { $status->getName()->shouldBeCalled()->willReturn('Open'); $status->getType()->shouldBeCalled()->willReturn('initial'); $status2->getName()->shouldBeCalled()->willReturn('In progress'); $status2->getType()->shouldBeCalled()->willReturn('normal'); $transition->getInitialStates()->shouldBeCalled()->willReturn([$status]); $transition->getName()->shouldBeCalled()->willReturn('Start progress'); $transition->getState()->shouldBeCalled()->willReturn($status2); $this->load($issue, [$status, $status2], [$transition])->shouldReturnAnInstanceOf('Kreta\\Component\\Issue\\StateMachine\\IssueStateMachine'); }
/** * {@inheritdoc} */ public function getFiniteState() { return $this->status->getName(); }
function its_finite_state_is_mutable(ProjectInterface $project, WorkflowInterface $workflow, StatusInterface $status) { $status->getName()->shouldBeCalled()->willReturn('Done'); $project->getWorkflow()->shouldBeCalled()->willReturn($workflow); $workflow->getStatuses()->shouldBeCalled()->willReturn([$status]); $this->setProject($project); $this->setFiniteState('Done')->shouldReturn($this); $this->getFiniteState()->shouldReturn('Done'); }