public function testHandlingReservationCreationDelegatesToServicesForValidationAndPersistenceAndNotification() { $builder = new ExistingReservationSeriesBuilder(); $series = $builder->Build(); $instance = new Reservation($series, NullDateRange::Instance()); $series->WithCurrentInstance($instance); $this->handler->expects($this->once())->method('Handle')->with($this->equalTo($series), $this->equalTo($this->page))->will($this->returnValue(true)); $this->presenter->HandleReservation($series); }
public function PageLoad() { try { $reservation = $this->presenter->BuildReservation(); $this->presenter->HandleReservation($reservation); if ($this->reservationSavedSuccessfully) { $this->Display('Ajax/reservation/delete_successful.tpl'); } else { $this->Display('Ajax/reservation/delete_failed.tpl'); } } catch (Exception $ex) { Log::Error('ReservationDeletePage - Critical error saving reservation: %s', $ex); $this->Display('Ajax/reservation/reservation_error.tpl'); } }