1--TEST-- 2Test ImagickDraw, rotate 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$fillModifiedColor = 'LightCoral'; 12 13function rotate($strokeColor, $fillColor, $backgroundColor, $fillModifiedColor) { 14 $draw = new \ImagickDraw(); 15 $draw->setStrokeColor($strokeColor); 16 $draw->setStrokeOpacity(1); 17 $draw->setFillColor($fillColor); 18 $draw->rectangle(200, 200, 300, 300); 19 $draw->setFillColor($fillModifiedColor); 20 $draw->rotate(15); 21 $draw->rectangle(200, 200, 300, 300); 22 23 $image = new \Imagick(); 24 $image->newImage(500, 500, $backgroundColor); 25 $image->setImageFormat("png"); 26 $image->drawImage($draw); 27 28 $bytes = $image->getImageBlob(); 29 if (strlen($bytes) <= 0) { echo "Failed to generate image.";} 30} 31 32rotate($strokeColor, $fillColor, $backgroundColor, $fillModifiedColor) ; 33echo "Ok"; 34?> 35--EXPECTF-- 36Ok