1--TEST--
2Test ImagickDraw, pathStart
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 pathStart($strokeColor, $fillColor, $backgroundColor) {
13
14    $draw = new \ImagickDraw();
15
16    $draw->setStrokeOpacity(1);
17    $draw->setStrokeColor($strokeColor);
18    $draw->setFillColor($fillColor);
19
20    $draw->setStrokeWidth(2);
21    $draw->setFontSize(72);
22
23    $draw->pathStart();
24    $draw->pathMoveToAbsolute(50, 50);
25    $draw->pathLineToAbsolute(100, 50);
26    $draw->pathLineToRelative(0, 50);
27    $draw->pathLineToHorizontalRelative(-50);
28    $draw->pathFinish();
29
30    $draw->pathStart();
31    $draw->pathMoveToAbsolute(50, 50);
32    $draw->pathMoveToRelative(300, 0);
33    $draw->pathLineToRelative(50, 0);
34    $draw->pathLineToVerticalRelative(50);
35    $draw->pathLineToHorizontalAbsolute(350);
36    $draw->pathclose();
37    $draw->pathFinish();
38
39    $draw->pathStart();
40    $draw->pathMoveToAbsolute(50, 300);
41    $draw->pathCurveToAbsolute(50, 300, 100, 200, 300, 300);
42    $draw->pathLineToVerticalAbsolute(350);
43    $draw->pathFinish();
44
45    $imagick = new \Imagick();
46    $imagick->newImage(500, 500, $backgroundColor);
47    $imagick->setImageFormat("png");
48
49    $imagick->drawImage($draw);
50
51    $bytes = $imagick->getImageBlob();
52    if (strlen($bytes) <= 0) { echo "Failed to generate image.";}
53}
54
55pathStart($strokeColor, $fillColor, $backgroundColor) ;
56echo "Ok";
57?>
58--EXPECTF--
59Ok