1--TEST-- 2Test ImagickDraw, setFillColor 3--SKIPIF-- 4<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> 5--FILE-- 6<?php 7 8$backgroundColor = 'rgb(225, 225, 225)'; 9$strokeColor = 'rgb(0, 0, 0)'; 10$fillColor = 'DodgerBlue2'; 11 12function setFillColor($strokeColor, $fillColor, $backgroundColor) { 13 14 $draw = new \ImagickDraw(); 15 16 $draw->setStrokeOpacity(1); 17 $draw->setStrokeWidth(1.5); 18 $draw->setStrokeColor($strokeColor); 19 $draw->setFillColor($fillColor); 20 $draw->rectangle(50, 50, 150, 150); 21 22 $draw->setFillColor("rgb(200, 32, 32)"); 23 $draw->rectangle(200, 50, 300, 150); 24 25 $image = new \Imagick(); 26 $image->newImage(500, 500, $backgroundColor); 27 $image->setImageFormat("png"); 28 29 $image->drawImage($draw); 30 31 $bytes = $image->getImageBlob(); 32 if (strlen($bytes) <= 0) { echo "Failed to generate image.";} 33} 34 35setFillColor($strokeColor, $fillColor, $backgroundColor) ; 36echo "Ok"; 37?> 38--EXPECTF-- 39Ok