1--TEST--
2Test ImagickDraw, ellipse
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 ellipse($strokeColor, $fillColor, $backgroundColor) {
13
14    $draw = new \ImagickDraw();
15    $draw->setStrokeColor($strokeColor);
16    $draw->setFillColor($fillColor);
17
18    $draw->setStrokeWidth(2);
19    $draw->setFontSize(72);
20
21    $draw->ellipse(125, 70, 100, 50, 0, 360);
22    $draw->ellipse(350, 70, 100, 50, 0, 315);
23
24    $draw->push();
25    $draw->translate(125, 250);
26    $draw->rotate(30);
27    $draw->ellipse(0, 0, 100, 50, 0, 360);
28    $draw->pop();
29
30    $draw->push();
31    $draw->translate(350, 250);
32    $draw->rotate(30);
33    $draw->ellipse(0, 0, 100, 50, 0, 315);
34    $draw->pop();
35
36    $imagick = new \Imagick();
37    $imagick->newImage(500, 500, $backgroundColor);
38    $imagick->setImageFormat("png");
39
40    $imagick->drawImage($draw);
41
42    $bytes = $imagick->getImageBlob();
43    if (strlen($bytes) <= 0) { echo "Failed to generate image.";}
44}
45
46ellipse($strokeColor, $fillColor, $backgroundColor) ;
47echo "Ok";
48?>
49--EXPECTF--
50Ok