From 660cfeabb4ef3636821db29b23650956ea3a099b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9=20Ferrari?= Date: Sat, 5 Jul 2014 14:45:03 -0300 Subject: [PATCH 1/3] GD: imagepalettetotruecolor tests --- .../imagepalettetotruecolor_basic.phpt | 22 +++++++++++++++++++ .../imagepalettetotruecolor_error1.phpt | 14 ++++++++++++ .../imagepalettetotruecolor_error2.phpt | 14 ++++++++++++ .../imagepalettetotruecolor_error3.phpt | 15 +++++++++++++ 4 files changed, 65 insertions(+) create mode 100644 tests/caferrari/imagepalettetotruecolor_basic.phpt create mode 100644 tests/caferrari/imagepalettetotruecolor_error1.phpt create mode 100644 tests/caferrari/imagepalettetotruecolor_error2.phpt create mode 100644 tests/caferrari/imagepalettetotruecolor_error3.phpt diff --git a/tests/caferrari/imagepalettetotruecolor_basic.phpt b/tests/caferrari/imagepalettetotruecolor_basic.phpt new file mode 100644 index 00000000000..fd33a1e8f2c --- /dev/null +++ b/tests/caferrari/imagepalettetotruecolor_basic.phpt @@ -0,0 +1,22 @@ +--TEST-- +do the imagepalettetotruecollor function realy converts the image palette? +--CREDITS-- +Carlos André Ferrari +--SKIPIF-- + +--FILE-- + +--EXPECT-- +bool(true) +bool(false) +bool(true) +bool(true) diff --git a/tests/caferrari/imagepalettetotruecolor_error1.phpt b/tests/caferrari/imagepalettetotruecolor_error1.phpt new file mode 100644 index 00000000000..3c994e59a21 --- /dev/null +++ b/tests/caferrari/imagepalettetotruecolor_error1.phpt @@ -0,0 +1,14 @@ +--TEST-- +imagepalettetotruecollor must return an error if no resource is given +--CREDITS-- +Carlos André Ferrari +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: imagepalettetotruecolor() expects exactly 1 parameter, 0 given in %s on line %d diff --git a/tests/caferrari/imagepalettetotruecolor_error2.phpt b/tests/caferrari/imagepalettetotruecolor_error2.phpt new file mode 100644 index 00000000000..7a9a9ce5749 --- /dev/null +++ b/tests/caferrari/imagepalettetotruecolor_error2.phpt @@ -0,0 +1,14 @@ +--TEST-- +imagepalettetotruecollor must return an error if not a resource is given +--CREDITS-- +Carlos André Ferrari +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: imagepalettetotruecolor() expects parameter 1 to be resource, string given in %s on line %d diff --git a/tests/caferrari/imagepalettetotruecolor_error3.phpt b/tests/caferrari/imagepalettetotruecolor_error3.phpt new file mode 100644 index 00000000000..42a7e717736 --- /dev/null +++ b/tests/caferrari/imagepalettetotruecolor_error3.phpt @@ -0,0 +1,15 @@ +--TEST-- +imagepalettetotruecollor must return an error if not an image resource is given +--CREDITS-- +Carlos André Ferrari +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: imagepalettetotruecolor(): supplied resource is not a valid Image resource in %s on line %d From 2659b0f3cb7e591d332de07ad5dc33751685dba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9=20Ferrari?= Date: Tue, 8 Jul 2014 10:33:00 -0300 Subject: [PATCH 2/3] Fixed typo --- tests/caferrari/imagepalettetotruecolor_basic.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/caferrari/imagepalettetotruecolor_basic.phpt b/tests/caferrari/imagepalettetotruecolor_basic.phpt index fd33a1e8f2c..63a2b51e77d 100644 --- a/tests/caferrari/imagepalettetotruecolor_basic.phpt +++ b/tests/caferrari/imagepalettetotruecolor_basic.phpt @@ -1,5 +1,5 @@ --TEST-- -do the imagepalettetotruecollor function realy converts the image palette? +does the imagepalettetotruecollor function realy converts the image palette? --CREDITS-- Carlos André Ferrari --SKIPIF-- From 75f93ed663ce9b7e1f8742b6840505884a143682 Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Sun, 4 Jan 2015 19:45:57 -0800 Subject: [PATCH 3/3] fix GD tests with no GD loaded --- ext/gd/tests/bug67248.phpt | 2 +- ext/gd/tests/imagegd2_nullbyte_injection.phpt | 4 ++++ ext/gd/tests/imagegd_nullbyte_injection.phpt | 4 ++++ ext/gd/tests/imagegif_nullbyte_injection.phpt | 1 + ext/gd/tests/imagejpeg_nullbyte_injection.phpt | 1 + ext/gd/tests/imagepng_nullbyte_injection.phpt | 1 + ext/gd/tests/imagewbmp_nullbyte_injection.phpt | 1 + ext/gd/tests/imagewebp_nullbyte_injection.phpt | 1 + 8 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ext/gd/tests/bug67248.phpt b/ext/gd/tests/bug67248.phpt index 9c83966a60a..5cae5f8c98a 100644 --- a/ext/gd/tests/bug67248.phpt +++ b/ext/gd/tests/bug67248.phpt @@ -2,7 +2,7 @@ Bug #67248 (imageaffinematrixget missing check of parameters) --SKIPIF-- --FILE-- diff --git a/ext/gd/tests/imagegd2_nullbyte_injection.phpt b/ext/gd/tests/imagegd2_nullbyte_injection.phpt index 49affefb96b..278a4a80239 100644 --- a/ext/gd/tests/imagegd2_nullbyte_injection.phpt +++ b/ext/gd/tests/imagegd2_nullbyte_injection.phpt @@ -1,5 +1,9 @@ --TEST-- Testing null byte injection in imagegd2 +--SKIPIF-- + --CLEAN-- $tempdir = sys_get_temp_dir(). '/php-gdtest'; foreach (glob($tempdir . "/test*") as $file ) { unlink($file); } diff --git a/ext/gd/tests/imagegd_nullbyte_injection.phpt b/ext/gd/tests/imagegd_nullbyte_injection.phpt index a423a551fd4..1ef93549195 100644 --- a/ext/gd/tests/imagegd_nullbyte_injection.phpt +++ b/ext/gd/tests/imagegd_nullbyte_injection.phpt @@ -1,5 +1,9 @@ --TEST-- Testing null byte injection in imagegd +--SKIPIF-- + --CLEAN-- $tempdir = sys_get_temp_dir(). '/php-gdtest'; foreach (glob($tempdir . "/test*") as $file ) { unlink($file); } diff --git a/ext/gd/tests/imagegif_nullbyte_injection.phpt b/ext/gd/tests/imagegif_nullbyte_injection.phpt index c3d0c301759..44b1be144fa 100644 --- a/ext/gd/tests/imagegif_nullbyte_injection.phpt +++ b/ext/gd/tests/imagegif_nullbyte_injection.phpt @@ -6,6 +6,7 @@ foreach (glob($tempdir . "/test*") as $file ) { unlink($file); } rmdir($tempdir); --SKIPIF--