/** * This action generates an image with bug status statistics * for the current project/version. * @param integer $w Image width. * @param integer $h Image height. * @param integer $period Time period (7, 30 or 365). */ public function actionStatusDynamics($w, $h, $period) { // Check that user is authorized to view statistics of this project $this->checkAuthorization(null); Bug::generateBugStatusDynamicsGraph($w, $h, $period); }
public function testGenerateBugStatusDynamicsGraph7() { // Login as root $model = new LoginForm('RegularLogin'); $model->username = "******"; $model->password = "******"; $this->assertTrue($model->login()); // Create temp file for output $outFile = tempnam(Yii::app()->getRuntimePath(), "test"); // Generate an image for one year bug statistics Bug::generateBugStatusDynamicsGraph(320, 240, 7, $outFile); // Ensure the image exists $this->assertTrue(file_exists($outFile)); // Ensure image size is not 0 $this->assertTrue(filesize($outFile) > 0); // Delete image unlink($outFile); }