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); }
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); }