function it_stores_sprint_specifications(Specification $spec1, Specification $spec2) { $spec1->getSprintLength()->willReturn(10); $spec2->getSprintLength()->willReturn(15); $this->save($spec1); $this->save($spec2); $this->getSpecificationForSprintLength(10)->shouldReturn($spec1); $this->getSpecificationForSprintLength(15)->shouldReturn($spec2); }
public function createSpecification(Specification $specification) { if (!$specification->getSprintLength()) { $this->dispatcher->dispatch(self::FAILURE, new Event(['specification' => $specification, 'reason' => 'Specification does not have a length.'])); return; } if (!count($specification->getCeremonies())) { $this->dispatcher->dispatch(self::FAILURE, new Event(['specification' => $specification, 'reason' => 'Specification does not have ceremonies.'])); return; } $this->repository->save($specification); $this->dispatcher->dispatch(self::SUCCESS, new Event(['specification' => $specification])); }
function it_reports_failure_to_the_dispatcher(Specification $specification, $dispatcher) { $specification->getSprintLength()->willReturn(0); $dispatcher->dispatch($this->FAILURE, Argument::any())->shouldBeCalled(); $this->createSpecification($specification); }
function it_can_apply_specification(Specification $spec, Ceremony $ceremony1, Ceremony $ceremony2) { $spec->getCeremonies()->willReturn([$ceremony1, $ceremony2]); $this->applySpecification($spec); $this->getCeremonies()->shouldReturn([$ceremony1, $ceremony2]); }
public function applySpecification(Specification $specification) { $this->ceremonies = $specification->getCeremonies(); }
public function save(Specification $specification) { $this->specifications[$specification->getSprintLength()] = $specification; }