Skip to content

Commit 450d4e6

Browse files
committed
add test
1 parent a39dca1 commit 450d4e6

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

ext/gd/tests/imageclone.phpt

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

0 commit comments

Comments
 (0)