public function testGetsUserReservationsForTheNextYearByResourceId() { $publicId = '1'; $reservationResult = array(new TestReservationItemView(1, Date::Now(), Date::Now())); $userId = 999; $user = new FakeUser($userId); $weekAgo = Date::Now()->AddDays(-7); $nextYear = Date::Now()->AddDays(365); $this->page->expects($this->once())->method('GetUserId')->will($this->returnValue($publicId)); $this->service->expects($this->once())->method('GetUser')->with($this->equalTo($publicId))->will($this->returnValue($user)); $this->repo->expects($this->once())->method('GetReservationList')->with($this->equalTo($weekAgo), $this->equalTo($nextYear), $this->equalTo($userId), $this->isNull(), $this->isNull(), $this->isNull())->will($this->returnValue($reservationResult)); $this->page->expects($this->once())->method('SetReservations')->with($this->arrayHasKey(0)); $this->presenter->PageLoad(); }
private function StubSubscriptionKey() { $this->page->expects($this->once())->method('GetSubscriptionKey')->will($this->returnValue('123')); $this->fakeConfig->SetSectionKey(ConfigSection::ICS, ConfigKeys::ICS_SUBSCRIPTION_KEY, '123'); }