1--TEST-- 2Test ImagickDraw, roundRectangle 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$startX = 50; 12$startY = 50; 13$endX = 400; 14$endY = 400; 15$roundX = 100; 16$roundY = 50; 17 18function roundRectangle($strokeColor, $fillColor, $backgroundColor, $startX, $startY, $endX, $endY, $roundX, $roundY) { 19 20 $draw = new \ImagickDraw(); 21 22 $draw->setStrokeColor($strokeColor); 23 $draw->setFillColor($fillColor); 24 $draw->setStrokeOpacity(1); 25 $draw->setStrokeWidth(2); 26 27 $draw->roundRectangle($startX, $startY, $endX, $endY, $roundX, $roundY); 28 29 $imagick = new \Imagick(); 30 $imagick->newImage(500, 500, $backgroundColor); 31 $imagick->setImageFormat("png"); 32 33 $imagick->drawImage($draw); 34 35 $bytes = $imagick->getImageBlob(); 36 if (strlen($bytes) <= 0) { echo "Failed to generate image.";} 37} 38 39roundRectangle($strokeColor, $fillColor, $backgroundColor, $startX, $startY, $endX, $endY, $roundX, $roundY) ; 40echo "Ok"; 41?> 42--EXPECTF-- 43Ok