1--TEST--
2imagesetclip() - basic functionality
3--EXTENSIONS--
4gd
5--FILE--
6<?php
7// draw a clipped diagonal line
8$im = imagecreate(100, 100);
9imagecolorallocate($im, 0, 0, 0);
10$white = imagecolorallocate($im, 255, 255, 255);
11imagesetclip($im, 10,10, 89,89);
12imageline($im, 0,0, 99,99, $white);
13
14// save image for manual inspection
15// imagepng($im, __FILE__ . '.png');
16
17// verify that the clipping has been respected
18imagesetclip($im, 0,0, 99,99);
19var_dump(imagecolorat($im, 9,9) !== $white);
20var_dump(imagecolorat($im, 90,90) !== $white);
21?>
22--EXPECT--
23bool(true)
24bool(true)
25