public function testCanGetLayoutForScheduleOnDate()
 {
     $user = $this->fakeUser;
     $page = $this->getMock('ISchedulePage');
     $scheduleService = $this->getMock('IScheduleService');
     $resourceService = $this->getMock('IResourceService');
     $pageBuilder = $this->getMock('ISchedulePageBuilder');
     $reservationService = $this->getMock('IReservationService');
     $dailyLayoutFactory = $this->getMock('IDailyLayoutFactory');
     $layout = $this->getMock('IScheduleLayout');
     $dateString = '2013-01-07';
     $date = Date::Parse($dateString, $user->Timezone);
     $periods = array();
     $scheduleId = 1928;
     $expectedLayoutResponse = new ScheduleLayoutSerializable($periods);
     $page->expects($this->once())->method('GetScheduleId')->will($this->returnValue($scheduleId));
     $page->expects($this->once())->method('GetLayoutDate')->will($this->returnValue($dateString));
     $scheduleService->expects($this->once())->method('GetLayout')->with($this->equalTo($scheduleId), $this->equalTo(new ScheduleLayoutFactory($user->Timezone)))->will($this->returnValue($layout));
     $layout->expects($this->once())->method('GetLayout')->with($this->equalTo($date))->will($this->returnValue($periods));
     $page->expects($this->once())->method('SetLayoutResponse')->with($this->equalTo($expectedLayoutResponse));
     $presenter = new SchedulePresenter($page, $scheduleService, $resourceService, $pageBuilder, $reservationService, $dailyLayoutFactory);
     $presenter->GetLayout($user);
 }
Example #2
0
 public function ProcessDataRequest($dataRequest)
 {
     $this->_presenter->GetLayout(ServiceLocator::GetServer()->GetUserSession());
 }