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