예제 #1
0
 public function rentFirstFreeZoneLocker(User $user, Zone $zone)
 {
     $locker = $this->lockerRepository->findOneFreeZoneLocker($zone);
     if (!$locker) {
         throw new NotFreeZoneLockerException();
     }
     return $this->rentLocker($user, $locker);
 }
예제 #2
0
 public function it_cannot_rent_without_free_lockers(User $user, LockerRepository $lockerRepository)
 {
     $lockerRepository->findOneFreeLocker()->shouldBeCalled()->willReturn(null);
     $this->shouldThrow(NotFreeLockerException::class)->duringRentFirstFreeLocker($user);
 }