function it_does_not_save_a_zero_ceremonies_specification(Specification $specification, $repository) { $specification->getSprintLength()->willReturn(10); $specification->getCeremonies()->willReturn([]); $repository->save($specification)->shouldNotBeCalled(); $this->createSpecification($specification); }
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_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(); }