public function test_loadImage() { $image_handler = new XoopsCaptchaImageHandler(); ob_start(); @$image_handler->loadImage(); $tmp = ob_end_clean(); $this->assertTrue(true); // loadImage returns void }
{ for ($i = 1; $i <= $this->config["background_num"]; $i++) { $randomcolor = imagecolorallocate($this->oImage, mt_rand(190, 255), mt_rand(190, 255), mt_rand(190, 255)); $coords = array(); for ($j = 1; $j <= $this->config["polygon_point"]; $j++) { $coords[] = mt_rand(0, $this->width); $coords[] = mt_rand(0, $this->height); } imagefilledpolygon($this->oImage, $coords, $this->config["polygon_point"], $randomcolor); } } /**#@-*/ /** * Create CAPTCHA image with BMP * * TODO */ function createImageBmp($file = "") { $image = ""; if (empty($file)) { header("Content-type: image/bmp"); echo $image; } else { return $image; } } } $image_handler = new XoopsCaptchaImageHandler(); $image_handler->loadImage();