function it_returns_true_because_the_transition_is_in_use_by_any_issue(WorkflowInterface $workflow, StatusInterface $status, ProjectInterface $project, IssueInterface $issue, StatusInterface $status) { $this->setWorkflow($workflow)->shouldReturn($this); $this->getWorkflow()->shouldReturn($workflow); $workflow->getProjects()->shouldBeCalled()->willReturn([$project]); $project->getIssues()->shouldBeCalled()->willReturn([$issue]); $issue->getStatus()->shouldBeCalled()->willReturn($status); $status->getId()->shouldBeCalled()->willReturn(null); $this->getId()->shouldReturn(null); $this->isInUse()->shouldReturn(true); }
function it_gets_notifications(IssueInterface $issue, UserInterface $assignee, UserInterface $reporter, ProjectInterface $project, RouterInterface $router, NotificationFactory $factory, NotificationInterface $notification) { $issue->getAssignee()->shouldBeCalled()->willReturn($assignee); $issue->getReporter()->shouldBeCalled()->willReturn($reporter); $issue->getProject()->shouldBeCalled()->willReturn($project); $issue->getId()->shouldBeCalled()->willReturn('issue-id'); $router->generate('get_issue', ['issueId' => 'issue-id'])->shouldBeCalled()->willReturn('http://kreta.io'); $factory->create()->shouldBeCalled()->willReturn($notification); $issue->getProject()->shouldBeCalled()->willReturn($project); $notification->setProject($project)->shouldBeCalled()->willReturn($notification); $issue->getTitle()->shouldBeCalled()->willReturn('Issue title'); $notification->setTitle('Issue title')->shouldBeCalled()->willReturn($notification); $issue->getDescription()->shouldBeCalled()->willReturn('The issue description'); $notification->setDescription('The issue description')->shouldBeCalled()->willReturn($notification); $notification->setType('issue_new')->shouldBeCalled()->willReturn($notification); $notification->setResourceUrl('http://kreta.io')->shouldBeCalled()->willReturn($notification); $notification->setWebUrl('http://kreta.io')->shouldBeCalled()->willReturn($notification); $issue->getAssignee()->shouldBeCalled()->willReturn($assignee); $notification->setUser($assignee)->shouldBeCalled()->willReturn($notification); $this->getNotifications('postPersist', $issue)->shouldReturn([$notification]); }