public function testLoadsExistingReservationAndDeletesIt()
 {
     $referenceNumber = '109809';
     $seriesUpdateScope = SeriesUpdateScope::ThisInstance;
     $expectedSeries = $this->getMock('ExistingReservationSeries');
     $this->page->expects($this->once())->method('GetReferenceNumber')->will($this->returnValue($referenceNumber));
     $this->page->expects($this->once())->method('GetSeriesUpdateScope')->will($this->returnValue($seriesUpdateScope));
     $this->persistenceService->expects($this->once())->method('LoadByReferenceNumber')->with($this->equalTo($referenceNumber))->will($this->returnValue($expectedSeries));
     $expectedSeries->expects($this->once())->method('Delete')->with($this->user);
     $expectedSeries->expects($this->once())->method('ApplyChangesTo')->with($this->equalTo($seriesUpdateScope));
     $existingSeries = $this->presenter->BuildReservation();
 }
示例#2
0
 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');
     }
 }