summaryrefslogtreecommitdiff
path: root/ext/gd/tests/imagecolorallocatealpha_basic.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gd/tests/imagecolorallocatealpha_basic.phpt')
-rw-r--r--ext/gd/tests/imagecolorallocatealpha_basic.phpt30
1 files changed, 30 insertions, 0 deletions
diff --git a/ext/gd/tests/imagecolorallocatealpha_basic.phpt b/ext/gd/tests/imagecolorallocatealpha_basic.phpt
new file mode 100644
index 0000000..720c500
--- /dev/null
+++ b/ext/gd/tests/imagecolorallocatealpha_basic.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Testing imagecolorallocatealpha()
+--CREDITS--
+Rafael Dohms <rdohms [at] gmail [dot] com>
+--SKIPIF--
+<?php
+ if (!extension_loaded("gd")) die("skip GD not present");
+?>
+--FILE--
+<?php
+$img = imagecreatetruecolor(150, 150);
+
+$cor = imagecolorallocate($img, 50, 100, 255);
+$corA = imagecolorallocatealpha($img, 50, 100, 255, 50);
+//$whiteA = imagecolorallocatealpha($img, 255, 255, 255, 127);
+
+$half = imagefilledarc ( $img, 75, 75, 70, 70, 0, 180, $cor, IMG_ARC_PIE );
+$half2 = imagefilledarc ( $img, 75, 75, 70, 70, 180, 360, $corA, IMG_ARC_PIE );
+
+ob_start();
+imagepng($img, null, 9);
+$imgsrc = ob_get_contents();
+ob_end_clean();
+
+var_dump(md5(base64_encode($imgsrc)));
+var_dump($corA);
+?>
+--EXPECT--
+string(32) "b856a0b1a15efe0f79551ebbb5651fe8"
+int(842163455) \ No newline at end of file