/** * 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; }
public function testGetChart() { $this->configService->method('getChartConfigById')->willReturn($this->configMock); $adapter = $this->chartService->getChart($this->configMock->getId()); $this->assertInstanceOf('OCA\\ocUsageCharts\\Adapters\\ChartTypeAdapterInterface', $adapter); }