public function testDeletesSavedReport()
 {
     $reportId = 100;
     $this->page->_ReportId = $reportId;
     $this->service->expects($this->once())->method('DeleteSavedReport')->with($this->equalTo($reportId), $this->equalTo($this->fakeUser->UserId));
     $this->presenter->DeleteReport();
 }
 public function testSavesReport()
 {
     $this->SetupPage();
     $reportName = 'report name';
     $this->page->_ReportName = $reportName;
     $expectedStart = $this->page->_RangeStart;
     $expectedEnd = $this->page->_RangeEnd;
     $usage = new Report_Usage($this->page->_Usage);
     $selection = new Report_ResultSelection($this->page->_ResultSelection);
     $groupBy = new Report_GroupBy($this->page->_GroupBy);
     $range = new Report_Range($this->page->_Range, $expectedStart, $expectedEnd, $this->fakeUser->Timezone);
     $filter = new Report_Filter($this->page->_ResourceId, $this->page->_ScheduleId, $this->page->_UserId, $this->page->_GroupId, $this->page->_AccessoryId, $this->page->_ParticipantId);
     $this->reportingService->expects($this->once())->method('Save')->with($this->equalTo($reportName), $this->equalTo($this->fakeUser->UserId), $this->equalTo($usage), $this->equalTo($selection), $this->equalTo($groupBy), $this->equalTo($range), $this->equalTo($filter));
     $this->presenter->SaveReport();
 }
Exemplo n.º 3
0
 public function DeleteReport()
 {
     $reportId = $this->page->GetReportId();
     $userId = $this->user->UserId;
     Log::Debug('Deleting saved report. reportId: %s, userId: %s', $reportId, $userId);
     $this->service->DeleteSavedReport($reportId, $userId);
 }
Exemplo n.º 4
0
 private function BindReport()
 {
     $usage = $this->GetUsage();
     $selection = $this->GetSelection();
     $groupBy = $this->GetGroupBy();
     $range = $this->GetRange();
     $filter = $this->GetFilter();
     $report = $this->reportingService->GenerateCustomReport($usage, $selection, $groupBy, $range, $filter);
     $reportDefinition = new ReportDefinition($report, $this->user->Timezone);
     $this->page->BindReport($report, $reportDefinition);
 }