public function getProjectSprints(Project $project)
 {
     if (!isset($this->sprints[$project->getName()])) {
         return [];
     }
     return $this->sprints[$project->getName()];
 }
Ejemplo n.º 2
0
 public function createProject(Project $project)
 {
     if (!$project->getName()) {
         $this->dispatcher->dispatch(self::FAILURE, new Event(['project' => $project, 'reason' => 'Project does not have a name.']));
         return;
     }
     $this->repository->save($project);
     $this->dispatcher->dispatch(self::SUCCESS, new Event(['project' => $project]));
 }
Ejemplo n.º 3
0
 function it_reports_success_to_the_dispatcher(Project $project, $dispatcher)
 {
     $project->getName()->willReturn('Nokia');
     $dispatcher->dispatch($this->SUCCESS, Argument::any())->shouldBeCalled();
     $this->createProject($project);
 }
 function it_returns_empty_array_if_project_has_no_sprints(Project $project)
 {
     $project->getName()->willReturn('Nokia');
     $this->getProjectSprints($project)->shouldReturn([]);
 }