Skip to content

Commit 03d0bf6

Browse files
committed
- add test
1 parent 34adce6 commit 03d0bf6

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

ext/gd/tests/imageflip.phpt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
--TEST--
2+
Testing imageflip() of GD library
3+
--SKIPIF--
4+
<?php
5+
if ( ! extension_loaded('gd') || !function_exists('imageflip')) die( 'skip GD not present; skipping test' );
6+
?>
7+
--FILE--
8+
<?php
9+
10+
$im = imagecreatetruecolor( 99, 99 );
11+
12+
imagesetpixel($im, 0, 0, 0xFF);
13+
imagesetpixel($im, 0, 98, 0x00FF00);
14+
imagesetpixel($im, 98, 0, 0xFF0000);
15+
imagesetpixel($im, 98, 98, 0x0000FF);
16+
17+
imageflip($im, IMG_FLIP_HORINZONTAL);
18+
imageflip($im, IMG_FLIP_VERTICAL);
19+
imageflip($im, IMG_FLIP_BOTH);
20+
21+
22+
var_dump(dechex(imagecolorat($im, 0, 0)));
23+
var_dump(dechex(imagecolorat($im, 0, 98)));
24+
var_dump(dechex(imagecolorat($im, 98, 0)));
25+
var_dump(dechex(imagecolorat($im, 98, 98)));
26+
?>
27+
--EXPECT--
28+
string(2) "ff"
29+
string(4) "ff00"
30+
string(6) "ff0000"
31+
string(2) "ff"

0 commit comments

Comments
 (0)