Annotation of embedaddon/php/ext/gd/tests/imagecolorallocate_basic.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test imagecolorallocate() function : basic functionality
3: --SKIPIF--
4: <?php
5: if(!extension_loaded('gd')) {
6: die('skip gd extension is not loaded');
7: }
8: if(!function_exists('imagecreatetruecolor')) {
9: die('skip imagecreatetruecolor function is not available');
10: }
11: ?>
12: --FILE--
13: <?php
14: /* Prototype : int imagecolorallocate(resource im, int red, int green, int blue)
15: * Description: Allocate a color for an image
16: * Source code: ext/gd/gd.c
17: */
18:
19: echo "*** Testing imagecolorallocate() : basic functionality ***\n";
20:
21: $im = imagecreatetruecolor(200, 200);
22: // Calling imagecolorallocate() with all possible arguments
23: var_dump( imagecolorallocate($im, 255, 0, 0) );
24: var_dump( imagecolorallocate($im, 0, 255, 0) );
25: var_dump( imagecolorallocate($im, 0, 0, 255) );
26: var_dump( imagecolorallocate($im, 255, 255, 255) );
27: ?>
28: ===DONE===
29: --EXPECTF--
30: *** Testing imagecolorallocate() : basic functionality ***
31: int(16711680)
32: int(65280)
33: int(255)
34: int(16777215)
35: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>