/** * Test the configuration for the graph. */ public function testConfig() { $report = new CataractComplicationsReport(Yii::app()); $config = $report->graphConfig(); $configDecoded = json_decode($config, true); $this->assertInternalType('string', $config); //is a string $this->assertEquals('bar', $configDecoded['chart']['type']); // check it looks ok $this->assertEquals(false, $configDecoded['credits']['enabled']); //check globabl config merge $this->assertEquals('CataractComplicationsReport', $configDecoded['chart']['renderTo']); }
public function actionCataractComplicationTotal() { $reportObj = new CataractComplicationsReport(Yii::app()); $this->renderJSON(array($reportObj->getTotalComplications(), $reportObj->getTotalOperations())); }