public function testCannotSeeReservationDetailsIfConfiguredOff() { $referenceNumber = 'ref'; $reservationResult = new ReservationView(); $this->validator->expects($this->atLeastOnce())->method('IsValid')->will($this->returnValue(true)); $this->page->expects($this->once())->method('GetReferenceNumber')->will($this->returnValue($referenceNumber)); $this->repo->expects($this->once())->method('GetReservationForEditing')->with($this->equalTo($referenceNumber))->will($this->returnValue($reservationResult)); $this->page->expects($this->once())->method('SetReservations')->with($this->arrayHasKey(0)); $this->presenter->PageLoad($this->fakeUser); }
public function setup() { parent::setup(); $this->repo = $this->getMock('IReservationViewRepository'); $this->page = $this->getMock('ICalendarSubscriptionPage'); $this->validator = $this->getMock('ICalendarExportValidator'); $this->service = $this->getMock('ICalendarSubscriptionService'); $this->privacyFilter = new FakePrivacyFilter(); $this->validator->expects($this->atLeastOnce())->method('IsValid')->will($this->returnValue(true)); $this->presenter = new CalendarSubscriptionPresenter($this->page, $this->repo, $this->validator, $this->service, $this->privacyFilter); }