rdohms Mon, 24 Aug 2009 02:50:19 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=287624
Log: Adding tests for imagecolorallocatealpha Changed paths: A php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_basic.phpt A php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error1.phpt A php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error2.phpt A php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error3.phpt A php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error4.phpt A php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error5.phpt A php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_basic.phpt A php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_error1.phpt A php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_error2.phpt A php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_error3.phpt A php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_error4.phpt A php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_error5.phpt A php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_basic.phpt A php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_error1.phpt A php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_error2.phpt A php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_error3.phpt A php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_error4.phpt A php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_error5.phpt
Added: php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_basic.phpt =================================================================== --- php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_basic.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_basic.phpt 2009-08-24 02:50:19 UTC (rev 287624) @@ -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 Added: php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error1.phpt =================================================================== --- php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error1.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error1.phpt 2009-08-24 02:50:19 UTC (rev 287624) @@ -0,0 +1,25 @@ +--TEST-- +Testing imagecolorallocatealpha(): Wrong types for parameter 1 +--CREDITS-- +Rafael Dohms <rdohms [at] gmail [dot] com> +--SKIPIF-- +<?php + if (!extension_loaded("gd")) die("skip GD not present"); +?> +--FILE-- +<?php +$resource = tmpfile(); + +imagecolorallocatealpha($resource, 255, 255, 255, 50); +imagecolorallocatealpha('string', 255, 255, 255, 50); +imagecolorallocatealpha(array(), 255, 255, 255, 50); +imagecolorallocatealpha(null, 255, 255, 255, 50); +?> +--EXPECTF-- +Warning: imagecolorallocatealpha(): supplied resource is not a valid Image resource in %s on line %d + +Warning: imagecolorallocatealpha(): supplied argument is not a valid Image resource in %s on line %d + +Warning: imagecolorallocatealpha(): supplied argument is not a valid Image resource in %s on line %d + +Warning: imagecolorallocatealpha(): supplied argument is not a valid Image resource in %s on line %d \ No newline at end of file Added: php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error2.phpt =================================================================== --- php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error2.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error2.phpt 2009-08-24 02:50:19 UTC (rev 287624) @@ -0,0 +1,22 @@ +--TEST-- +Testing imagecolorallocatealpha(): Wrong types for parameter 2 +--CREDITS-- +Rafael Dohms <rdohms [at] gmail [dot] com> +--SKIPIF-- +<?php + if (!extension_loaded("gd")) die("skip GD not present"); +?> +--FILE-- +<?php +$img = imagecreatetruecolor(200, 200); + +imagecolorallocatealpha($img, 'string-non-numeric', 255, 255, 50); +imagecolorallocatealpha($img, array(), 255, 255, 50); +imagecolorallocatealpha($img, tmpfile(), 255, 255, 50); +?> +--EXPECTF-- +Warning: imagecolorallocatealpha() expects parameter 2 to be long, %s given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 2 to be long, array given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 2 to be long, resource given in %s on line %d \ No newline at end of file Added: php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error3.phpt =================================================================== --- php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error3.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error3.phpt 2009-08-24 02:50:19 UTC (rev 287624) @@ -0,0 +1,22 @@ +--TEST-- +Testing imagecolorallocatealpha(): Wrong types for parameter 3 +--CREDITS-- +Rafael Dohms <rdohms [at] gmail [dot] com> +--SKIPIF-- +<?php + if (!extension_loaded("gd")) die("skip GD not present"); +?> +--FILE-- +<?php +$img = imagecreatetruecolor(200, 200); + +imagecolorallocatealpha($img, 255, 'string-non-numeric', 255, 50); +imagecolorallocatealpha($img, 255, array(), 255, 50); +imagecolorallocatealpha($img, 255, tmpfile(), 255, 50); +?> +--EXPECTF-- +Warning: imagecolorallocatealpha() expects parameter 3 to be long, %s given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 3 to be long, array given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 3 to be long, resource given in %s on line %d \ No newline at end of file Added: php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error4.phpt =================================================================== --- php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error4.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error4.phpt 2009-08-24 02:50:19 UTC (rev 287624) @@ -0,0 +1,22 @@ +--TEST-- +Testing imagecolorallocatealpha(): Wrong types for parameter 4 +--CREDITS-- +Rafael Dohms <rdohms [at] gmail [dot] com> +--SKIPIF-- +<?php + if (!extension_loaded("gd")) die("skip GD not present"); +?> +--FILE-- +<?php +$img = imagecreatetruecolor(200, 200); + +imagecolorallocatealpha($img, 255, 255, 'string-non-numeric', 50); +imagecolorallocatealpha($img, 255, 255, array(), 50); +imagecolorallocatealpha($img, 255, 255, tmpfile(), 50); +?> +--EXPECTF-- +Warning: imagecolorallocatealpha() expects parameter 4 to be long, %s given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 4 to be long, array given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 4 to be long, resource given in %s on line %d \ No newline at end of file Added: php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error5.phpt =================================================================== --- php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error5.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error5.phpt 2009-08-24 02:50:19 UTC (rev 287624) @@ -0,0 +1,22 @@ +--TEST-- +Testing imagecolorallocatealpha(): Wrong types for parameter 5 +--CREDITS-- +Rafael Dohms <rdohms [at] gmail [dot] com> +--SKIPIF-- +<?php + if (!extension_loaded("gd")) die("skip GD not present"); +?> +--FILE-- +<?php +$img = imagecreatetruecolor(200, 200); + +imagecolorallocatealpha($img, 255, 255, 255, 'string-non-numeric'); +imagecolorallocatealpha($img, 255, 255, 255, array()); +imagecolorallocatealpha($img, 255, 255, 255, tmpfile()); +?> +--EXPECTF-- +Warning: imagecolorallocatealpha() expects parameter 5 to be long, %s given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 5 to be long, array given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 5 to be long, resource given in %s on line %d \ No newline at end of file Added: php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_basic.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_basic.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_basic.phpt 2009-08-24 02:50:19 UTC (rev 287624) @@ -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 Added: php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_error1.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_error1.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_error1.phpt 2009-08-24 02:50:19 UTC (rev 287624) @@ -0,0 +1,25 @@ +--TEST-- +Testing imagecolorallocatealpha(): Wrong types for parameter 1 +--CREDITS-- +Rafael Dohms <rdohms [at] gmail [dot] com> +--SKIPIF-- +<?php + if (!extension_loaded("gd")) die("skip GD not present"); +?> +--FILE-- +<?php +$resource = tmpfile(); + +imagecolorallocatealpha($resource, 255, 255, 255, 50); +imagecolorallocatealpha('string', 255, 255, 255, 50); +imagecolorallocatealpha(array(), 255, 255, 255, 50); +imagecolorallocatealpha(null, 255, 255, 255, 50); +?> +--EXPECTF-- +Warning: imagecolorallocatealpha(): supplied resource is not a valid Image resource in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 1 to be resource, %s given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 1 to be resource, array given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 1 to be resource, null given in %s on line %d \ No newline at end of file Added: php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_error2.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_error2.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_error2.phpt 2009-08-24 02:50:19 UTC (rev 287624) @@ -0,0 +1,22 @@ +--TEST-- +Testing imagecolorallocatealpha(): Wrong types for parameter 2 +--CREDITS-- +Rafael Dohms <rdohms [at] gmail [dot] com> +--SKIPIF-- +<?php + if (!extension_loaded("gd")) die("skip GD not present"); +?> +--FILE-- +<?php +$img = imagecreatetruecolor(200, 200); + +imagecolorallocatealpha($img, 'string-non-numeric', 255, 255, 50); +imagecolorallocatealpha($img, array(), 255, 255, 50); +imagecolorallocatealpha($img, tmpfile(), 255, 255, 50); +?> +--EXPECTF-- +Warning: imagecolorallocatealpha() expects parameter 2 to be long, %s given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 2 to be long, array given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 2 to be long, resource given in %s on line %d \ No newline at end of file Added: php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_error3.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_error3.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_error3.phpt 2009-08-24 02:50:19 UTC (rev 287624) @@ -0,0 +1,22 @@ +--TEST-- +Testing imagecolorallocatealpha(): Wrong types for parameter 3 +--CREDITS-- +Rafael Dohms <rdohms [at] gmail [dot] com> +--SKIPIF-- +<?php + if (!extension_loaded("gd")) die("skip GD not present"); +?> +--FILE-- +<?php +$img = imagecreatetruecolor(200, 200); + +imagecolorallocatealpha($img, 255, 'string-non-numeric', 255, 50); +imagecolorallocatealpha($img, 255, array(), 255, 50); +imagecolorallocatealpha($img, 255, tmpfile(), 255, 50); +?> +--EXPECTF-- +Warning: imagecolorallocatealpha() expects parameter 3 to be long, %s given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 3 to be long, array given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 3 to be long, resource given in %s on line %d \ No newline at end of file Added: php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_error4.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_error4.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_error4.phpt 2009-08-24 02:50:19 UTC (rev 287624) @@ -0,0 +1,22 @@ +--TEST-- +Testing imagecolorallocatealpha(): Wrong types for parameter 4 +--CREDITS-- +Rafael Dohms <rdohms [at] gmail [dot] com> +--SKIPIF-- +<?php + if (!extension_loaded("gd")) die("skip GD not present"); +?> +--FILE-- +<?php +$img = imagecreatetruecolor(200, 200); + +imagecolorallocatealpha($img, 255, 255, 'string-non-numeric', 50); +imagecolorallocatealpha($img, 255, 255, array(), 50); +imagecolorallocatealpha($img, 255, 255, tmpfile(), 50); +?> +--EXPECTF-- +Warning: imagecolorallocatealpha() expects parameter 4 to be long, %s given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 4 to be long, array given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 4 to be long, resource given in %s on line %d \ No newline at end of file Added: php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_error5.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_error5.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_error5.phpt 2009-08-24 02:50:19 UTC (rev 287624) @@ -0,0 +1,22 @@ +--TEST-- +Testing imagecolorallocatealpha(): Wrong types for parameter 5 +--CREDITS-- +Rafael Dohms <rdohms [at] gmail [dot] com> +--SKIPIF-- +<?php + if (!extension_loaded("gd")) die("skip GD not present"); +?> +--FILE-- +<?php +$img = imagecreatetruecolor(200, 200); + +imagecolorallocatealpha($img, 255, 255, 255, 'string-non-numeric'); +imagecolorallocatealpha($img, 255, 255, 255, array()); +imagecolorallocatealpha($img, 255, 255, 255, tmpfile()); +?> +--EXPECTF-- +Warning: imagecolorallocatealpha() expects parameter 5 to be long, %s given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 5 to be long, array given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 5 to be long, resource given in %s on line %d \ No newline at end of file Added: php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_basic.phpt =================================================================== --- php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_basic.phpt (rev 0) +++ php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_basic.phpt 2009-08-24 02:50:19 UTC (rev 287624) @@ -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-- +unicode(32) "b856a0b1a15efe0f79551ebbb5651fe8" +int(842163455) \ No newline at end of file Added: php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_error1.phpt =================================================================== --- php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_error1.phpt (rev 0) +++ php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_error1.phpt 2009-08-24 02:50:19 UTC (rev 287624) @@ -0,0 +1,25 @@ +--TEST-- +Testing imagecolorallocatealpha(): Wrong types for parameter 1 +--CREDITS-- +Rafael Dohms <rdohms [at] gmail [dot] com> +--SKIPIF-- +<?php + if (!extension_loaded("gd")) die("skip GD not present"); +?> +--FILE-- +<?php +$resource = tmpfile(); + +imagecolorallocatealpha($resource, 255, 255, 255, 50); +imagecolorallocatealpha('string', 255, 255, 255, 50); +imagecolorallocatealpha(array(), 255, 255, 255, 50); +imagecolorallocatealpha(null, 255, 255, 255, 50); +?> +--EXPECTF-- +Warning: imagecolorallocatealpha(): supplied resource is not a valid Image resource in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 1 to be resource, %s given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 1 to be resource, array given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 1 to be resource, null given in %s on line %d \ No newline at end of file Added: php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_error2.phpt =================================================================== --- php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_error2.phpt (rev 0) +++ php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_error2.phpt 2009-08-24 02:50:19 UTC (rev 287624) @@ -0,0 +1,22 @@ +--TEST-- +Testing imagecolorallocatealpha(): Wrong types for parameter 2 +--CREDITS-- +Rafael Dohms <rdohms [at] gmail [dot] com> +--SKIPIF-- +<?php + if (!extension_loaded("gd")) die("skip GD not present"); +?> +--FILE-- +<?php +$img = imagecreatetruecolor(200, 200); + +imagecolorallocatealpha($img, 'string-non-numeric', 255, 255, 50); +imagecolorallocatealpha($img, array(), 255, 255, 50); +imagecolorallocatealpha($img, tmpfile(), 255, 255, 50); +?> +--EXPECTF-- +Warning: imagecolorallocatealpha() expects parameter 2 to be long, %s given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 2 to be long, array given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 2 to be long, resource given in %s on line %d \ No newline at end of file Added: php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_error3.phpt =================================================================== --- php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_error3.phpt (rev 0) +++ php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_error3.phpt 2009-08-24 02:50:19 UTC (rev 287624) @@ -0,0 +1,22 @@ +--TEST-- +Testing imagecolorallocatealpha(): Wrong types for parameter 3 +--CREDITS-- +Rafael Dohms <rdohms [at] gmail [dot] com> +--SKIPIF-- +<?php + if (!extension_loaded("gd")) die("skip GD not present"); +?> +--FILE-- +<?php +$img = imagecreatetruecolor(200, 200); + +imagecolorallocatealpha($img, 255, 'string-non-numeric', 255, 50); +imagecolorallocatealpha($img, 255, array(), 255, 50); +imagecolorallocatealpha($img, 255, tmpfile(), 255, 50); +?> +--EXPECTF-- +Warning: imagecolorallocatealpha() expects parameter 3 to be long, %s given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 3 to be long, array given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 3 to be long, resource given in %s on line %d \ No newline at end of file Added: php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_error4.phpt =================================================================== --- php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_error4.phpt (rev 0) +++ php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_error4.phpt 2009-08-24 02:50:19 UTC (rev 287624) @@ -0,0 +1,22 @@ +--TEST-- +Testing imagecolorallocatealpha(): Wrong types for parameter 4 +--CREDITS-- +Rafael Dohms <rdohms [at] gmail [dot] com> +--SKIPIF-- +<?php + if (!extension_loaded("gd")) die("skip GD not present"); +?> +--FILE-- +<?php +$img = imagecreatetruecolor(200, 200); + +imagecolorallocatealpha($img, 255, 255, 'string-non-numeric', 50); +imagecolorallocatealpha($img, 255, 255, array(), 50); +imagecolorallocatealpha($img, 255, 255, tmpfile(), 50); +?> +--EXPECTF-- +Warning: imagecolorallocatealpha() expects parameter 4 to be long, %s given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 4 to be long, array given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 4 to be long, resource given in %s on line %d \ No newline at end of file Added: php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_error5.phpt =================================================================== --- php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_error5.phpt (rev 0) +++ php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_error5.phpt 2009-08-24 02:50:19 UTC (rev 287624) @@ -0,0 +1,22 @@ +--TEST-- +Testing imagecolorallocatealpha(): Wrong types for parameter 5 +--CREDITS-- +Rafael Dohms <rdohms [at] gmail [dot] com> +--SKIPIF-- +<?php + if (!extension_loaded("gd")) die("skip GD not present"); +?> +--FILE-- +<?php +$img = imagecreatetruecolor(200, 200); + +imagecolorallocatealpha($img, 255, 255, 255, 'string-non-numeric'); +imagecolorallocatealpha($img, 255, 255, 255, array()); +imagecolorallocatealpha($img, 255, 255, 255, tmpfile()); +?> +--EXPECTF-- +Warning: imagecolorallocatealpha() expects parameter 5 to be long, %s given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 5 to be long, array given in %s on line %d + +Warning: imagecolorallocatealpha() expects parameter 5 to be long, resource given in %s on line %d \ No newline at end of file
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php