コード例 #1
0
 public function actionVersionDist($w, $h)
 {
     // Check if user is authorized to perform the action
     $this->checkAuthorization(null);
     // Generate a version distribution graph for currently selected project
     CrashReport::generateVersionDistributionGraph($w, $h);
 }
コード例 #2
0
ファイル: CrashReportTest.php プロジェクト: xyzz/CrashFix
 public function testGenerateVersionDistributionGraph7()
 {
     // 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::generateVersionDistributionGraph(320, 240, $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);
 }