mirror of
https://github.com/php/php-src.git
synced 2024-11-28 12:26:37 +08:00
Merge branch 'pull-request/742' into PHP-5.5
* pull-request/742: Fixed typo GD: imagepalettetotruecolor tests
This commit is contained in:
commit
5639c3350e
22
ext/gd/tests/imagepalettetotruecolor_basic.phpt
Normal file
22
ext/gd/tests/imagepalettetotruecolor_basic.phpt
Normal file
@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
does the imagepalettetotruecollor function realy converts the image palette?
|
||||
--CREDITS--
|
||||
Carlos André Ferrari <caferrari [at] gmail [dot] com>
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die("skip gd extension not available.");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$im = imagecreate(100, 100);
|
||||
var_dump(is_resource($im));
|
||||
var_dump(imageistruecolor($im));
|
||||
var_dump(imagepalettetotruecolor($im));
|
||||
var_dump(imageistruecolor($im));
|
||||
imagedestroy($im);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
14
ext/gd/tests/imagepalettetotruecolor_error1.phpt
Normal file
14
ext/gd/tests/imagepalettetotruecolor_error1.phpt
Normal file
@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
imagepalettetotruecollor must return an error if no resource is given
|
||||
--CREDITS--
|
||||
Carlos André Ferrari <caferrari [at] gmail [dot] com>
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die("skip gd extension not available.");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
imagepalettetotruecolor();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: imagepalettetotruecolor() expects exactly 1 parameter, 0 given in %s on line %d
|
14
ext/gd/tests/imagepalettetotruecolor_error2.phpt
Normal file
14
ext/gd/tests/imagepalettetotruecolor_error2.phpt
Normal file
@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
imagepalettetotruecollor must return an error if not a resource is given
|
||||
--CREDITS--
|
||||
Carlos André Ferrari <caferrari [at] gmail [dot] com>
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die("skip gd extension not available.");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
imagepalettetotruecolor("bla");
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: imagepalettetotruecolor() expects parameter 1 to be resource, string given in %s on line %d
|
15
ext/gd/tests/imagepalettetotruecolor_error3.phpt
Normal file
15
ext/gd/tests/imagepalettetotruecolor_error3.phpt
Normal file
@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
imagepalettetotruecollor must return an error if not an image resource is given
|
||||
--CREDITS--
|
||||
Carlos André Ferrari <caferrari [at] gmail [dot] com>
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die("skip gd extension not available.");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$im = fopen('php://memory', 'w');
|
||||
imagepalettetotruecolor($im);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: imagepalettetotruecolor(): supplied resource is not a valid Image resource in %s on line %d
|
Loading…
Reference in New Issue
Block a user