コード例 #1
0
 /**
  * JSON Ajax call
  *
  * @NoAdminRequired
  * @NoCSRFRequired
  * @param string $id
  * @return JSONResponse
  */
 public function loadChart($id)
 {
     $chart = $this->chartService->getChart($id);
     $usage = $this->chartService->getChartUsage($chart->getConfig());
     $response = new JSONResponse($usage);
     return $response;
 }
コード例 #2
0
 public function testGetChart()
 {
     $this->configService->method('getChartConfigById')->willReturn($this->configMock);
     $adapter = $this->chartService->getChart($this->configMock->getId());
     $this->assertInstanceOf('OCA\\ocUsageCharts\\Adapters\\ChartTypeAdapterInterface', $adapter);
 }