public function getProjectSprints(Project $project)
 {
     if (!isset($this->sprints[$project->getName()])) {
         return [];
     }
     return $this->sprints[$project->getName()];
 }
 public function save(Project $project)
 {
     $manager = $project->getManager();
     if (!isset($this->projects[$manager->getName()])) {
         $this->projects[$manager->getName()] = [];
     }
     $this->projects[$manager->getName()][] = $project;
 }
Ejemplo n.º 3
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]));
 }
 function it_stores_projects_of_specific_managers(Project $project1, Project $project2, ProjectManager $manager1, ProjectManager $manager2)
 {
     $manager1->getName()->willReturn('everzet');
     $manager2->getName()->willReturn('_md');
     $project1->getManager()->willReturn($manager1);
     $project2->getManager()->willReturn($manager2);
     $this->save($project1);
     $this->save($project2);
     $this->getManagerProjects($manager1)->shouldReturn([$project1]);
     $this->getManagerProjects($manager2)->shouldReturn([$project2]);
 }
Ejemplo n.º 5
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([]);
 }