1--TEST--
2Test ImagickDraw, setTextDecoration
3--SKIPIF--
4<?php
5$imageMagickRequiredVersion=0x675;
6require_once(dirname(__FILE__) . '/skipif.inc');
7?>
8--FILE--
9<?php
10
11require_once(dirname(__FILE__) . '/functions.inc');
12
13$backgroundColor = 'rgb(225, 225, 225)';
14$strokeColor = 'rgb(0, 0, 0)';
15$fillColor = 'DodgerBlue2';
16$textDecoration = 2;
17
18function setTextDecoration($strokeColor, $fillColor, $backgroundColor, $textDecoration) {
19
20    $draw = new \ImagickDraw();
21    setFontForImagickDraw($draw);
22
23    $draw->setStrokeColor($strokeColor);
24    $draw->setFillColor($fillColor);
25    $draw->setStrokeWidth(2);
26    $draw->setFontSize(72);
27    $draw->setTextDecoration($textDecoration);
28    $draw->annotation(50, 75, "Lorem Ipsum!");
29
30    $imagick = new \Imagick();
31    $imagick->newImage(500, 500, $backgroundColor);
32    $imagick->setImageFormat("png");
33    $imagick->drawImage($draw);
34
35    $bytes = $imagick->getImageBlob();
36    if (strlen($bytes) <= 0) { echo "Failed to generate image.";}
37}
38
39setTextDecoration($strokeColor, $fillColor, $backgroundColor, $textDecoration) ;
40echo "Ok";
41?>
42--EXPECTF--
43Ok