Skip to content

Commit 46e200a

Browse files
committed
add test
1 parent a39dca1 commit 46e200a

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

ext/gd/tests/imageclone.phpt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
--TEST--
2+
imageclone()
3+
--EXTENSIONS--
4+
gd
5+
--SKIPIF--
6+
<?php
7+
if (!function_exists("imageclone")) {
8+
die("skip imageclone unavailable");
9+
}
10+
--FILE--
11+
<?php
12+
13+
$orig = imagecreate(100, 100);
14+
15+
$color_orig = imagecolorallocate($orig, 255, 0, 1);
16+
17+
imagefill($orig, 0, 0, $color_orig);
18+
19+
$copy = imageclone($orig);
20+
21+
var_dump($copy === $orig);
22+
var_dump(imagesx($copy) == imagesx($orig));
23+
var_dump(imagesy($copy) == imagesy($orig));
24+
25+
$rgb_orig = imagecolorat($orig, 0, 0);
26+
$rgb_copy = imagecolorat($copy, 0, 0);
27+
28+
var_dump($rgb_orig == $rgb_copy);
29+
30+
?>
31+
--EXPECT--
32+
bool(false)
33+
bool(true)
34+
bool(true)
35+
bool(true)

0 commit comments

Comments
 (0)