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