/** * This action generates an image with crash report upload statistics * for the current project/version. */ public function actionUploadStat($w, $h, $period) { // Check if user is authorized to perform the action $this->checkAuthorization(null); // Generate an upload statistics graph for current project CrashReport::generateUploadStatisticsGraph($w, $h, $period); }
public function testGenerateUploadStatisticsGraph7() { // Login as root $loginForm = new LoginForm('RegularLogin'); $loginForm->username = "******"; $loginForm->password = "******"; $this->assertTrue($loginForm->login()); // Create temp file for output $outFile = tempnam(Yii::app()->getRuntimePath(), "test"); // Generate an image for one year debug info statistics CrashReport::generateUploadStatisticsGraph(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); }