public function actionGeoLocationDist($w, $h) { // Check if user is authorized to perform the action $this->checkAuthorization(null); // Generate a version distribution graph for currently selected project CrashReport::generateGeoLocationDistributionGraph($w, $h); }
public function testGenerateGeoLocationDistributionGraph() { // 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::generateGeoLocationDistributionGraph(320, 240, $outFile); // Ensure the file exists $this->assertTrue(file_exists($outFile)); // Ensure file size is not 0 $this->assertTrue(filesize($outFile) > 0); // Delete image unlink($outFile); }