/** * This action generates an image with debug info upload statistics * for the current project. */ public function actionUploadStat($w, $h, $period) { // Check if user is authorized to perform this action $this->checkAuthorization(null); DebugInfo::generateDebugInfoUploadStat($w, $h, $period); }
public function testGenerateDebugInfoUploadStat7() { // Create temp file for output $outFile = tempnam(Yii::app()->getRuntimePath(), "test"); // Generate an image for one year debug info statistics DebugInfo::generateDebugInfoUploadStat(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); }