Skip to content

Commit ebaf150

Browse files
committed
add test
1 parent 2711285 commit ebaf150

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

ext/gd/tests/imagecropaffine.phpt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
--TEST--
2+
imagecrop/imageaffine matrix checks
3+
--EXTENSIONS--
4+
gd
5+
--FILE--
6+
<?php
7+
$img = imagecreatetruecolor(10, 10);
8+
9+
try {
10+
imagecrop($img, array("x" => PHP_INT_MAX, "y" => 10, "width" => 10, "height" => 105));
11+
} catch (\ValueError $e) {
12+
echo $e->getMessage() . PHP_EOL;
13+
}
14+
15+
try {
16+
imageaffine($img, array(1, 2, 3, 4, 5, 6), array("x" => 120, "y" => 180, "width" => PHP_INT_MAX, "height" => 10));
17+
} catch (\ValueError $e) {
18+
echo $e->getMessage();
19+
}
20+
?>
21+
--EXPECT--
22+
imagecrop(): Argument #2 ($rectangle) invalid "x" key value
23+
imageaffine(): Argument #3 ($clip) invalid "width" key value

0 commit comments

Comments
 (0)