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