public function testShowsErrorFileDoesNotBelongToReservation()
 {
     $fileId = 110;
     $resourceId = 1909;
     $referenceNumber = 'rn';
     $seriesId = 1;
     $fileSeriesId = 2;
     $builder = new ExistingReservationSeriesBuilder();
     $builder->WithId($seriesId);
     $builder->WithPrimaryResource(new FakeBookableResource($resourceId));
     $reservationSeries = $builder->Build();
     $reservationAttachment = new FakeReservationAttachment($fileId);
     $reservationAttachment->SetSeriesId($fileSeriesId);
     $this->page->expects($this->once())->method('GetFileId')->will($this->returnValue($fileId));
     $this->page->expects($this->once())->method('GetReferenceNumber')->will($this->returnValue($referenceNumber));
     $this->reservationRepository->expects($this->once())->method('LoadReservationAttachment')->with($this->equalTo($fileId))->will($this->returnValue($reservationAttachment));
     $this->reservationRepository->expects($this->once())->method('LoadByReferenceNumber')->with($this->equalTo($referenceNumber))->will($this->returnValue($reservationSeries));
     $this->page->expects($this->once())->method('ShowError');
     $this->presenter->PageLoad($this->fakeUser);
 }
예제 #2
0
 public function PageLoad()
 {
     $this->presenter = new ReservationAttachmentPresenter($this, new ReservationRepository(), PluginManager::Instance()->LoadPermission());
     $this->presenter->PageLoad(ServiceLocator::GetServer()->GetUserSession());
 }