/** * 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 testGetChartUsage() { $return = array('1'); $this->dataProvider->method('getChartUsage')->with($this->configMock)->willReturn($return); $data = $this->chartService->getChartUsage($this->configMock); $this->assertEquals($return, $data); }