1--TEST--
2Test ImagickDraw, push
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 push($strokeColor, $fillColor, $backgroundColor, $fillModifiedColor) {
14
15    $draw = new \ImagickDraw();
16    $draw->setStrokeColor($strokeColor);
17    $draw->setFillColor($fillModifiedColor);
18    $draw->setStrokeWidth(2);
19    $draw->setFontSize(72);
20    $draw->push();
21    $draw->translate(50, 50);
22    $draw->rectangle(200, 200, 300, 300);
23    $draw->pop();
24    $draw->setFillColor($fillColor);
25    $draw->rectangle(200, 200, 300, 300);
26
27    $imagick = new \Imagick();
28    $imagick->newImage(500, 500, $backgroundColor);
29    $imagick->setImageFormat("png");
30
31    $imagick->drawImage($draw);
32
33    $bytes = $imagick->getImageBlob();
34    if (strlen($bytes) <= 0) { echo "Failed to generate image.";}
35}
36
37push($strokeColor, $fillColor, $backgroundColor, $fillModifiedColor) ;
38echo "Ok";
39?>
40--EXPECTF--
41Ok