Remove more zpp error/variation tests

This commit is contained in:
Nikita Popov 2019-03-05 11:55:03 +01:00
parent 4bd18db8cc
commit 7e3f4a2390
91 changed files with 0 additions and 2395 deletions

View File

@ -1,38 +0,0 @@
--TEST--
Test gd_info() function : error conditions - with more than expected number of arguments
--SKIPIF--
<?php
if(!extension_loaded('gd')) {
die('skip gd extension is not loaded');
}
if(!function_exists('gd_info')) {
die('skip gd_info function is not available');
}
?>
--FILE--
<?php
/* Prototype : array gd_info()
* Description: Retrieve information about the currently installed GD library
* Source code: ext/gd/gd.c
*/
$extra_arg_number = 10;
$extra_arg_string = "Hello";
echo "*** Testing gd_info() : error conditions ***\n";
echo "\n-- Testing gd_info() function with more than expected number of arguments --\n";
var_dump(gd_info($extra_arg_number));
var_dump(gd_info($extra_arg_string, $extra_arg_number));
?>
===DONE===
--EXPECTF--
*** Testing gd_info() : error conditions ***
-- Testing gd_info() function with more than expected number of arguments --
Warning: gd_info() expects exactly 0 parameters, 1 given in %s on line %d
NULL
Warning: gd_info() expects exactly 0 parameters, 2 given in %s on line %d
NULL
===DONE===

View File

@ -1,15 +0,0 @@
--TEST--
test imagealphablending without arguments
--CREDITS--
Marcelo Diniz <marcelo.leo27 [at] gmail [dot] com
#phpspMaisTestFest PHPSP on 2014-07-05
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available.");
?>
--FILE--
<?php
imagealphablending();
?>
--EXPECTF--
Warning: imagealphablending() expects exactly 2 parameters, 0 given in %s on line %d

View File

@ -1,25 +0,0 @@
--TEST--
Testing wrong param passing imagearc() of GD library
--CREDITS--
Edgar Ferreira da Silva <contato [at] edgarfs [dot] com [dot] br>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(100, 100);
$white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
//create an arc with white color
imagearc($image, 50, 50, 30, 30, 0, 180);
include_once __DIR__ . '/func.inc';
test_image_equals_file(__DIR__ . '/imagearc_error1.png', $image);
?>
--EXPECTF--
Warning: imagearc() expects exactly 8 parameters, 7 given in %s on line %d
The images are equal.

View File

@ -1,17 +0,0 @@
--TEST--
Testing error on non-resource parameter 1 of imagechar() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$result = imagechar('string', 1, 5, 5, 'C', 1);
?>
--EXPECTF--
Warning: imagechar() expects parameter 1 to be resource, %s given in %s on line %d

View File

@ -1,17 +0,0 @@
--TEST--
Testing error on non-long parameter 2 of imagechar() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
$result = imagechar($image, 'string', 5, 5, 'C', 1);
?>
--EXPECTF--
Warning: imagechar() expects parameter 2 to be int, %s given in %s on line %d

View File

@ -1,17 +0,0 @@
--TEST--
Testing error on non-long parameter 3 of imagechar() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
$result = imagechar($image, 1, 'string', 5, 'C', 1);
?>
--EXPECTF--
Warning: imagechar() expects parameter 3 to be int, %s given in %s on line %d

View File

@ -1,17 +0,0 @@
--TEST--
Testing error on non-long parameter 4 of imagechar() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
$result = imagechar($image, 1, 5, 'string', 'C', 1);
?>
--EXPECTF--
Warning: imagechar() expects parameter 4 to be int, %s given in %s on line %d

View File

@ -1,17 +0,0 @@
--TEST--
Testing error on non-string parameter 5 of imagechar() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
$result = imagechar($image, 1, 5, 5, $image, 1);
?>
--EXPECTF--
Warning: imagechar() expects parameter 5 to be string%S, %s given in %s on line %d

View File

@ -1,17 +0,0 @@
--TEST--
Testing error on non-long parameter 6 of imagechar() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
$result = imagechar($image, 1, 5, 5, 'C', 'font');
?>
--EXPECTF--
Warning: imagechar() expects parameter 6 to be int, %s given in %s on line %d

View File

@ -1,17 +0,0 @@
--TEST--
Testing error on non-resource parameter 1 of imagecharup() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$result = imagecharup('string', 1, 5, 5, 'C', 1);
?>
--EXPECTF--
Warning: imagecharup() expects parameter 1 to be resource, %s given in %s on line %d

View File

@ -1,17 +0,0 @@
--TEST--
Testing error on non-long parameter 2 of imagecharup() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
$result = imagecharup($image, 'string', 5, 5, 'C', 1);
?>
--EXPECTF--
Warning: imagecharup() expects parameter 2 to be int, %s given in %s on line %d

View File

@ -1,17 +0,0 @@
--TEST--
Testing error on non-long parameter 3 of imagecharup() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
$result = imagecharup($image, 1, 'string', 5, 'C', 1);
?>
--EXPECTF--
Warning: imagecharup() expects parameter 3 to be int, %s given in %s on line %d

View File

@ -1,17 +0,0 @@
--TEST--
Testing error on non-long parameter 4 of imagecharup() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
$result = imagecharup($image, 1, 5, 'string', 'C', 1);
?>
--EXPECTF--
Warning: imagecharup() expects parameter 4 to be int, %s given in %s on line %d

View File

@ -1,17 +0,0 @@
--TEST--
Testing error on non-string parameter 5 of imagecharup() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
$result = imagecharup($image, 1, 5, 5, $image, 1);
?>
--EXPECTF--
Warning: imagecharup() expects parameter 5 to be string%S, %s given in %s on line %d

View File

@ -1,17 +0,0 @@
--TEST--
Testing error on non-long parameter 6 of imagecharup() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
$result = imagecharup($image, 1, 5, 5, 'C', 'font');
?>
--EXPECTF--
Warning: imagecharup() expects parameter 6 to be int, %s given in %s on line %d

View File

@ -1,49 +0,0 @@
--TEST--
Test imagecolorallocate() function : error conditions
--SKIPIF--
<?php
if(!extension_loaded('gd')) {
die('skip gd extension is not loaded');
}
?>
--FILE--
<?php
/* Prototype : int imagecolorallocate(resource im, int red, int green, int blue)
* Description: Allocate a color for an image
* Source code: ext/gd/gd.c
*/
$red = 10;
$green = 10;
$blue = 10;
$extra_arg = 10;
$im = imagecreate(200, 200);
echo "*** Testing imagecolorallocate() : error conditions ***\n";
//Test imagecolorallocate with one more than the expected number of arguments
echo "\n-- Testing imagecolorallocate() function with more than expected no. of arguments --\n";
var_dump( imagecolorallocate($im, $red, $green, $blue, $extra_arg) );
// Testing imagecolorallocate with one less than the expected number of arguments
echo "\n-- Testing imagecolorallocate() function with less than expected no. of arguments --\n";
var_dump( imagecolorallocate() );
var_dump( imagecolorallocate($im, $red, $green) );
?>
===DONE===
--EXPECTF--
*** Testing imagecolorallocate() : error conditions ***
-- Testing imagecolorallocate() function with more than expected no. of arguments --
Warning: imagecolorallocate() expects exactly 4 parameters, 5 given in %s on line %d
NULL
-- Testing imagecolorallocate() function with less than expected no. of arguments --
Warning: imagecolorallocate() expects exactly 4 parameters, 0 given in %s on line %d
NULL
Warning: imagecolorallocate() expects exactly 4 parameters, 3 given in %s on line %d
NULL
===DONE===

View File

@ -1,22 +0,0 @@
--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 int, %s given in %s on line %d
Warning: imagecolorallocatealpha() expects parameter 2 to be int, array given in %s on line %d
Warning: imagecolorallocatealpha() expects parameter 2 to be int, resource given in %s on line %d

View File

@ -1,22 +0,0 @@
--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 int, %s given in %s on line %d
Warning: imagecolorallocatealpha() expects parameter 3 to be int, array given in %s on line %d
Warning: imagecolorallocatealpha() expects parameter 3 to be int, resource given in %s on line %d

View File

@ -1,22 +0,0 @@
--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 int, %s given in %s on line %d
Warning: imagecolorallocatealpha() expects parameter 4 to be int, array given in %s on line %d
Warning: imagecolorallocatealpha() expects parameter 4 to be int, resource given in %s on line %d

View File

@ -1,22 +0,0 @@
--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 int, %s given in %s on line %d
Warning: imagecolorallocatealpha() expects parameter 5 to be int, array given in %s on line %d
Warning: imagecolorallocatealpha() expects parameter 5 to be int, resource given in %s on line %d

View File

@ -1,30 +0,0 @@
--TEST--
imagecolorclosesthwb() test
--SKIPIF--
<?php
if(!extension_loaded('gd')){ die('skip: gd extension not available'); }
if(!function_exists('imagecolorclosesthwb')){ die('skip: imagecolorclosesthwb() not available'); }
?>
--FILE--
<?php
$im = imagecreatefrompng(dirname(__FILE__).'/test.png');
var_dump(imagecolorclosesthwb($im, 255, 50, 0));
var_dump(imagecolorclosesthwb(NULL));
var_dump(imagecolorclosesthwb(NULL, NULL, NULL, NULL));
var_dump(imagecolorclosesthwb($im, "hello", "from", "gd"));
imagedestroy($im);
?>
--EXPECTF--
int(16724480)
Warning: imagecolorclosesthwb() expects exactly 4 parameters, 1 given in %s on line %d
NULL
Warning: imagecolorclosesthwb() expects parameter 1 to be resource, null given in %s on line %d
NULL
Warning: imagecolorclosesthwb() expects parameter 2 to be int, string given in %s on line %d
NULL

View File

@ -1,19 +0,0 @@
--TEST--
Testing imagecolordeallocate() of GD library with no resource
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
$white = imagecolorallocate($image, 255, 255, 255);
$result = imagecolordeallocate('image', $white);
?>
--EXPECTF--
Warning: imagecolordeallocate() expects parameter 1 to be resource, %s given %s on line %d

View File

@ -1,18 +0,0 @@
--TEST--
Send only 1 parameter imagecolormatch() of GD library
--CREDITS--
Paulo Alves de Sousa Filho <pspalves [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$ima = imagecreatetruecolor(110, 20);
$background_color = imagecolorallocate($ima, 0, 0, 0);
var_dump(imagecolormatch($ima));
?>
--EXPECTF--
Warning: imagecolormatch() expects exactly 2 parameters, %d given in %s on line %d
NULL

View File

@ -1,15 +0,0 @@
--TEST--
test imagecolorresolvealpha without arguments
--CREDITS--
Marcelo Diniz <marcelo.leo27 [at] gmail [dot] com
#phpspMaisTestFest PHPSP on 2014-07-05
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available.");
?>
--FILE--
<?php
imagecolorresolvealpha();
?>
--EXPECTF--
Warning: imagecolorresolvealpha() expects exactly 5 parameters, 0 given in %s on line %d

View File

@ -1,27 +0,0 @@
--TEST--
Testing wrong param passing imageconvolution() of GD library
--CREDITS--
Guilherme Blanco <guilhermeblanco [at] hotmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
// Writes the text and apply a gaussian blur on the image
imagestring($image, 5, 10, 8, 'Gaussian Blur Text', 0x00ff00);
$gaussian = array(
array(1.0, 2.0, 1.0),
array(2.0, 4.0, 2.0),
array(1.0, 2.0, 1.0)
);
var_dump(imageconvolution($image, $gaussian, 16));
?>
--EXPECTF--
Warning: imageconvolution() expects exactly 4 parameters, 3 given in %s on line %d
bool(false)

View File

@ -1,17 +0,0 @@
--TEST--
Testing wrong parameter passing imagecopymerge() of GD library
--CREDITS--
Cleston Viel Vieira de Sousa <cleston [dot] vs [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
imagecopymerge();
?>
--EXPECTF--
Warning: imagecopymerge() expects exactly 9 parameters, 0 given in %s on line %d

View File

@ -1,18 +0,0 @@
--TEST--
Testing imagecreatetruecolor(): error on non-long parameters
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
if (!function_exists("imagecreatetruecolor")) die("skip GD Version not compatible");
?>
--FILE--
<?php
$image = imagecreatetruecolor('s', 30);
$image = imagecreatetruecolor(30, 's');
?>
--EXPECTF--
Warning: imagecreatetruecolor() expects parameter 1 to be int, %s given in %s on line %d
Warning: imagecreatetruecolor() expects parameter 2 to be int, %s given in %s on line %d

View File

@ -1,21 +0,0 @@
--TEST--
Testing imagecreatetruecolor(): error on wrong parameter count
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
if (!function_exists("imagecreatetruecolor")) die("skip GD Version not compatible");
?>
--FILE--
<?php
$image = imagecreatetruecolor();
$image = imagecreatetruecolor(30);
$image = imagecreatetruecolor(1,1,1);
?>
--EXPECTF--
Warning: imagecreatetruecolor() expects exactly 2 parameters, 0 given in %s on line %d
Warning: imagecreatetruecolor() expects exactly 2 parameters, 1 given in %s on line %d
Warning: imagecreatetruecolor() expects exactly 2 parameters, 3 given in %s on line %d

View File

@ -1,21 +0,0 @@
--TEST--
Testing wrong param passing imageellipse() of GD library
--CREDITS--
Ivan Rosolen <contato [at] ivanrosolen [dot] com>
#testfest PHPSP on 2009-06-30
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
// Create a image
$image = imagecreatetruecolor(400, 300);
// try to draw a white ellipse
imageellipse('wrong param', 200, 150, 300, 200, 16777215);
?>
--EXPECTF--
Warning: imageellipse() expects parameter 1 to be resource, %s given in %s on line %d

View File

@ -1,21 +0,0 @@
--TEST--
Testing wrong param passing imageellipse() of GD library
--CREDITS--
Ivan Rosolen <contato [at] ivanrosolen [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
// Create a image
$image = imagecreatetruecolor(400, 300);
// try to draw a white ellipse
imageellipse($image, 'wrong param', 150, 300, 200, 16777215);
?>
--EXPECTF--
Warning: imageellipse() expects parameter 2 to be int, %s given in %s on line %d

View File

@ -1,21 +0,0 @@
--TEST--
Testing wrong param passing imageellipse() of GD library
--CREDITS--
Ivan Rosolen <contato [at] ivanrosolen [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
// Create a image
$image = imagecreatetruecolor(400, 300);
// try to draw a white ellipse
imageellipse($image, 200, 'wrong param', 300, 200, 16777215);
?>
--EXPECTF--
Warning: imageellipse() expects parameter 3 to be int, %s given in %s on line %d

View File

@ -1,21 +0,0 @@
--TEST--
Testing wrong param passing imageellipse() of GD library
--CREDITS--
Ivan Rosolen <contato [at] ivanrosolen [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
// Create a image
$image = imagecreatetruecolor(400, 300);
// try to draw a white ellipse
imageellipse($image, 200, 150, 'wrong param', 200, 16777215);
?>
--EXPECTF--
Warning: imageellipse() expects parameter 4 to be int, %s given in %s on line %d

View File

@ -1,21 +0,0 @@
--TEST--
Testing wrong param passing imageellipse() of GD library
--CREDITS--
Ivan Rosolen <contato [at] ivanrosolen [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
// Create a image
$image = imagecreatetruecolor(400, 300);
// try to draw a white ellipse
imageellipse($image, 200, 150, 300, 'wrong param', 16777215);
?>
--EXPECTF--
Warning: imageellipse() expects parameter 5 to be int, %s given in %s on line %d

View File

@ -1,21 +0,0 @@
--TEST--
Testing wrong param passing imageellipse() of GD library
--CREDITS--
Ivan Rosolen <contato [at] ivanrosolen [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
// Create a image
$image = imagecreatetruecolor(400, 300);
// try to draw a white ellipse
imageellipse($image, 200, 150, 300, 200, 'wrong param');
?>
--EXPECTF--
Warning: imageellipse() expects parameter 6 to be int, %s given in %s on line %d

View File

@ -1,21 +0,0 @@
--TEST--
Testing wrong param passing imageellipse() of GD library
--CREDITS--
Ivan Rosolen <contato [at] ivanrosolen [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if ( ! extension_loaded("gd") ) die( 'skip GD not present; skipping test' );
?>
--FILE--
<?php
// Create a image
$image = imagecreatetruecolor( 400, 300 );
// try to draw a white ellipse
imageellipse( $image, 200, 150, 300, 200 );
?>
--EXPECTF--
Warning: imageellipse() expects exactly 6 parameters, %d given in %s on line %d

View File

@ -1,25 +0,0 @@
--TEST--
Testing wrong param passing imagefilledarc() of GD library
--CREDITS--
Edgar Ferreira da Silva <contato [at] edgarfs [dot] com [dot] br>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(100, 100);
$white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
//create an arc and fill it with white color
imagefilledarc($image, 50, 50, 30, 30, 0, 90, $white);
include_once __DIR__ . '/func.inc';
test_image_equals_file(__DIR__ . '/imagefilledarc_error1.png', $image);
?>
--EXPECTF--
Warning: imagefilledarc() expects exactly 9 parameters, 8 given in %s on line %d
The images are equal.

View File

@ -1,26 +0,0 @@
--TEST--
Testing wrong param passing imagefilltoborder() of GD library
--CREDITS--
Ivan Rosolen <contato [at] ivanrosolen [dot] com>
#testfest PHPSP on 2009-06-30
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
// Create a image
$image = imagecreatetruecolor( 100, 100 );
// Draw a rectangle
imagefilledrectangle( $image, 0, 0, 100, 100, imagecolorallocate( $image, 255, 255, 255 ) );
// Draw an ellipse to fill with a black border
imageellipse( $image, 50, 50, 50, 50, imagecolorallocate( $image, 0, 0, 0 ) );
// Try to fill border
imagefilltoborder( 'wrong param', 50, 50, imagecolorallocate( $image, 0, 0, 0 ), imagecolorallocate( $image, 255, 0, 0 ) );
?>
--EXPECTF--
Warning: imagefilltoborder() expects parameter 1 to be resource, %s given in %s on line %d

View File

@ -1,26 +0,0 @@
--TEST--
Testing wrong param passing imagefilltoborder() of GD library
--CREDITS--
Ivan Rosolen <contato [at] ivanrosolen [dot] com>
#testfest PHPSP on 2009-06-30
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
// Create a image
$image = imagecreatetruecolor( 100, 100 );
// Draw a rectangle
imagefilledrectangle( $image, 0, 0, 100, 100, imagecolorallocate( $image, 255, 255, 255 ) );
// Draw an ellipse to fill with a black border
imageellipse( $image, 50, 50, 50, 50, imagecolorallocate( $image, 0, 0, 0 ) );
// Try to fill border
imagefilltoborder( $image, 'wrong param', 50, imagecolorallocate( $image, 0, 0, 0 ), imagecolorallocate( $image, 255, 0, 0 ) );
?>
--EXPECTF--
Warning: imagefilltoborder() expects parameter 2 to be int, %s given in %s on line %d

View File

@ -1,26 +0,0 @@
--TEST--
Testing wrong param passing imagefilltoborder() of GD library
--CREDITS--
Ivan Rosolen <contato [at] ivanrosolen [dot] com>
#testfest PHPSP on 2009-06-30
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
// Create a image
$image = imagecreatetruecolor( 100, 100 );
// Draw a rectangle
imagefilledrectangle( $image, 0, 0, 100, 100, imagecolorallocate( $image, 255, 255, 255 ) );
// Draw an ellipse to fill with a black border
imageellipse( $image, 50, 50, 50, 50, imagecolorallocate( $image, 0, 0, 0 ) );
// Try to fill border
imagefilltoborder( $image, 50, 'wrong param', imagecolorallocate( $image, 0, 0, 0 ), imagecolorallocate( $image, 255, 0, 0 ) );
?>
--EXPECTF--
Warning: imagefilltoborder() expects parameter 3 to be int, %s given in %s on line %d

View File

@ -1,26 +0,0 @@
--TEST--
Testing wrong param passing imagefilltoborder() of GD library
--CREDITS--
Ivan Rosolen <contato [at] ivanrosolen [dot] com>
#testfest PHPSP on 2009-06-30
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
// Create a image
$image = imagecreatetruecolor( 100, 100 );
// Draw a rectangle
imagefilledrectangle( $image, 0, 0, 100, 100, imagecolorallocate( $image, 255, 255, 255 ) );
// Draw an ellipse to fill with a black border
imageellipse( $image, 50, 50, 50, 50, imagecolorallocate( $image, 0, 0, 0 ) );
// Try to fill border
imagefilltoborder( $image, 50, 50, 'wrong param', imagecolorallocate( $image, 255, 0, 0 ) );
?>
--EXPECTF--
Warning: imagefilltoborder() expects parameter 4 to be int, %s given in %s on line %d

View File

@ -1,26 +0,0 @@
--TEST--
Testing wrong param passing imagefilltoborder() of GD library
--CREDITS--
Ivan Rosolen <contato [at] ivanrosolen [dot] com>
#testfest PHPSP on 2009-06-30
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
// Create a image
$image = imagecreatetruecolor( 100, 100 );
// Draw a rectangle
imagefilledrectangle( $image, 0, 0, 100, 100, imagecolorallocate( $image, 255, 255, 255 ) );
// Draw an ellipse to fill with a black border
imageellipse( $image, 50, 50, 50, 50, imagecolorallocate( $image, 0, 0, 0 ) );
// Try to fill border
imagefilltoborder( $image, 50, 50, imagecolorallocate( $image, 0, 0, 0 ), 'wrong param' );
?>
--EXPECTF--
Warning: imagefilltoborder() expects parameter 5 to be int, %s given in %s on line %d

View File

@ -1,26 +0,0 @@
--TEST--
Testing wrong param passing imagefilltoborder() of GD library
--CREDITS--
Ivan Rosolen <contato [at] ivanrosolen [dot] com>
#testfest PHPSP on 2009-06-30
--SKIPIF--
<?php
if ( ! extension_loaded("gd")) die("skip GD not present; skipping test");
?>
--FILE--
<?php
// Create a image
$image = imagecreatetruecolor( 100, 100 );
// Draw a rectangle
imagefilledrectangle( $image, 0, 0, 100, 100, imagecolorallocate( $image, 255, 255, 255 ) );
// Draw an ellipse to fill with a black border
imageellipse( $image, 50, 50, 50, 50, imagecolorallocate( $image, 0, 0, 0 ) );
// Try to fill border
imagefilltoborder( $image, 50, 50 );
?>
--EXPECTF--
Warning: imagefilltoborder() expects exactly 5 parameters, %d given in %s on line %d

View File

@ -1,18 +0,0 @@
--TEST--
Testing wrong parameter type of COLORIZE in imagefilter() of GD library
--CREDITS--
Guilherme Blanco <guilhermeblanco [at] hotmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
var_dump(imagefilter($image, IMG_FILTER_COLORIZE, 'wrong parameter', 255, 255));
?>
--EXPECTF--
Warning: imagefilter() expects parameter 3 to be int, string given in %s on line %d
bool(false)

View File

@ -1,18 +0,0 @@
--TEST--
Testing wrong parameter type of CONTRAST in imagefilter() of GD library
--CREDITS--
Guilherme Blanco <guilhermeblanco [at] hotmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
var_dump(imagefilter($image, IMG_FILTER_CONTRAST, 'wrong parameter'));
?>
--EXPECTF--
Warning: imagefilter() expects parameter 3 to be int, string given in %s on line %d
bool(false)

View File

@ -1,18 +0,0 @@
--TEST--
Testing wrong parameter type of BRIGHTNESS in imagefilter() of GD library
--CREDITS--
Guilherme Blanco <guilhermeblanco [at] hotmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
var_dump(imagefilter($image, IMG_FILTER_BRIGHTNESS, 'wrong parameter'));
?>
--EXPECTF--
Warning: imagefilter() expects parameter 3 to be int, string given in %s on line %d
bool(false)

View File

@ -1,18 +0,0 @@
--TEST--
Testing wrong parameter passing in imagefilter() of GD library
--CREDITS--
Guilherme Blanco <guilhermeblanco [at] hotmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
var_dump(imagefilter($image, 'wrong parameter'));
?>
--EXPECTF--
Warning: imagefilter() expects parameter 2 to be int, string given in %s on line %d
NULL

View File

@ -1,18 +0,0 @@
--TEST--
Testing wrong parameter passing of PIXELATE in imagefilter() of GD library
--CREDITS--
Guilherme Blanco <guilhermeblanco [at] hotmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
var_dump(imagefilter($image, IMG_FILTER_PIXELATE, 'wrong parameter'));
?>
--EXPECTF--
Warning: imagefilter() expects parameter 3 to be int, string given in %s on line %d
bool(false)

View File

@ -1,18 +0,0 @@
--TEST--
Testing wrong parameter passing of SMOOTH in imagefilter() of GD library
--CREDITS--
Guilherme Blanco <guilhermeblanco [at] hotmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
var_dump(imagefilter($image, IMG_FILTER_SMOOTH, 'wrong parameter'));
?>
--EXPECTF--
Warning: imagefilter() expects parameter 3 to be float, string given in %s on line %d
bool(false)

View File

@ -1,15 +0,0 @@
--TEST--
Testing error on string parameter for imagefontheight() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
imagefontheight('string');
?>
--EXPECTF--
Warning: imagefontheight() expects parameter 1 to be int, %s given in %s on line %d

View File

@ -1,15 +0,0 @@
--TEST--
Testing error on string parameter for imagefontwidth() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
imagefontwidth('string');
?>
--EXPECTF--
Warning: imagefontwidth() expects parameter 1 to be int, %s given in %s on line %d

View File

@ -1,17 +0,0 @@
--TEST--
Testing error with non-resource paramenter of imagegammacorrect() of GD library,
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$gamma = imagegammacorrect('string', 1, 5);
?>
--EXPECTF--
Warning: imagegammacorrect() expects parameter 1 to be resource, %s given in %s on line %d

View File

@ -1,17 +0,0 @@
--TEST--
Testing error with non-double first paramenter of imagegammacorrect() of GD library,
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
$gamma = imagegammacorrect($image, 'string', 5);
?>
--EXPECTF--
Warning: imagegammacorrect() expects parameter 2 to be float, %s given in %s on line %d

View File

@ -1,17 +0,0 @@
--TEST--
Testing error with non-double second paramenter of imagegammacorrect() of GD library,
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
$gamma = imagegammacorrect($image, 1, 'string');
?>
--EXPECTF--
Warning: imagegammacorrect() expects parameter 3 to be float, %s given in %s on line %d

View File

@ -1,20 +0,0 @@
--TEST--
Testing passing no parameters to imageinterlace() of GD library
--CREDITS--
Edgar Ferreira da Silva <contato [at] edgarfs [dot] com [dot] br>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(100, 100);
//calling with no parameters
var_dump(imageinterlace());
?>
--EXPECTF--
Warning: imageinterlace() expects at least 1 parameter, 0 given in %s on line %d
NULL

View File

@ -1,16 +0,0 @@
--TEST--
Testing imagelayereffect() with invalid resource of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
if (!GD_BUNDLED) die('skip function only available in bundled, external GD detected');
?>
--FILE--
<?php
$layer = imagelayereffect('invalid_resource', IMG_EFFECT_REPLACE);
?>
--EXPECTF--
Warning: imagelayereffect() expects parameter 1 to be resource, %s given in %s on line %d

View File

@ -1,18 +0,0 @@
--TEST--
Testing imagelayereffect() wth invalid effect of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
if (!GD_BUNDLED) die('skip function only available in bundled, external GD detected');
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
$layer = imagelayereffect($image, 'IMG_EFFECT_REPLACE');
?>
--EXPECTF--
Warning: imagelayereffect() expects parameter 2 to be int, %s given in %s on line %d

View File

@ -1,15 +0,0 @@
--TEST--
Testing that imageloadfont() breaks on non-string first parameter
--CREDITS--
Neveo Harrison <neveoo [at] gmail [dot] com> #testfest #tek11
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
var_dump( imageloadfont(array()) );
?>
--EXPECTF--
Warning: imageloadfont() expects parameter 1 to be a valid path, array given in %s on line %d
NULL

View File

@ -1,14 +0,0 @@
--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

View File

@ -1,14 +0,0 @@
--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

View File

@ -1,19 +0,0 @@
--TEST--
Testing wrong param passing imagerectangle() of GD library
--CREDITS--
Ivan Rosolen <contato [at] ivanrosolen [dot] com>
#testfest PHPSP on 2009-06-30
--SKIPIF--
<?php
if ( ! extension_loaded('gd') ) die( 'skip GD not present; skipping test' );
?>
--FILE--
<?php
// Create a image
$image = imagecreatetruecolor( 100, 100 );
// Draw a rectangle
imagerectangle( 'wrong param', 0, 0, 50, 50, imagecolorallocate($image, 255, 255, 255) );
?>
--EXPECTF--
Warning: imagerectangle() expects parameter 1 to be resource, %s given in %s on line %d

View File

@ -1,19 +0,0 @@
--TEST--
Testing wrong param passing imagerectangle() of GD library
--CREDITS--
Ivan Rosolen <contato [at] ivanrosolen [dot] com>
#testfest PHPSP on 2009-06-30
--SKIPIF--
<?php
if ( ! extension_loaded('gd') ) die( 'skip GD not present; skipping test' );
?>
--FILE--
<?php
// Create a image
$image = imagecreatetruecolor( 100, 100 );
// Draw a rectangle
imagerectangle( $image, 'wrong param', 0, 50, 50, imagecolorallocate($image, 255, 255, 255) );
?>
--EXPECTF--
Warning: imagerectangle() expects parameter 2 to be int, %s given in %s on line %d

View File

@ -1,19 +0,0 @@
--TEST--
Testing wrong param passing imagerectangle() of GD library
--CREDITS--
Ivan Rosolen <contato [at] ivanrosolen [dot] com>
#testfest PHPSP on 2009-06-30
--SKIPIF--
<?php
if ( ! extension_loaded('gd') ) die( 'skip GD not present; skipping test' );
?>
--FILE--
<?php
// Create a image
$image = imagecreatetruecolor( 100, 100 );
// Draw a rectangle
imagerectangle( $image, 0, 'wrong param', 50, 50, imagecolorallocate($image, 255, 255, 255) );
?>
--EXPECTF--
Warning: imagerectangle() expects parameter 3 to be int, %s given in %s on line %d

View File

@ -1,19 +0,0 @@
--TEST--
Testing wrong param passing imagerectangle() of GD library
--CREDITS--
Ivan Rosolen <contato [at] ivanrosolen [dot] com>
#testfest PHPSP on 2009-06-30
--SKIPIF--
<?php
if ( ! extension_loaded('gd') ) die( 'skip GD not present; skipping test' );
?>
--FILE--
<?php
// Create a image
$image = imagecreatetruecolor( 100, 100 );
// Draw a rectangle
imagerectangle( $image, 0, 0, 'wrong param', 50, imagecolorallocate($image, 255, 255, 255) );
?>
--EXPECTF--
Warning: imagerectangle() expects parameter 4 to be int, %s given in %s on line %d

View File

@ -1,19 +0,0 @@
--TEST--
Testing wrong param passing imagerectangle() of GD library
--CREDITS--
Ivan Rosolen <contato [at] ivanrosolen [dot] com>
#testfest PHPSP on 2009-06-30
--SKIPIF--
<?php
if ( ! extension_loaded('gd') ) die( 'skip GD not present; skipping test' );
?>
--FILE--
<?php
// Create a image
$image = imagecreatetruecolor( 100, 100 );
// Draw a rectangle
imagerectangle( $image, 0, 0, 50, 'wrong param', imagecolorallocate($image, 255, 255, 255) );
?>
--EXPECTF--
Warning: imagerectangle() expects parameter 5 to be int, %s given in %s on line %d

View File

@ -1,19 +0,0 @@
--TEST--
Testing wrong param passing imagerectangle() of GD library
--CREDITS--
Ivan Rosolen <contato [at] ivanrosolen [dot] com>
#testfest PHPSP on 2009-06-30
--SKIPIF--
<?php
if ( ! extension_loaded('gd') ) die( 'skip GD not present; skipping test' );
?>
--FILE--
<?php
// Create a image
$image = imagecreatetruecolor( 100, 100 );
// Draw a rectangle
imagerectangle( $image, 0, 0, 50, 50, 'wrong param' );
?>
--EXPECTF--
Warning: imagerectangle() expects parameter 6 to be int, %s given in %s on line %d

View File

@ -1,19 +0,0 @@
--TEST--
Testing wrong param passing imagerectangle() of GD library
--CREDITS--
Ivan Rosolen <contato [at] ivanrosolen [dot] com>
#testfest PHPSP on 2009-06-30
--SKIPIF--
<?php
if ( ! extension_loaded('gd') ) die( 'skip GD not present; skipping test' );
?>
--FILE--
<?php
// Create a image
$image = imagecreatetruecolor( 100, 100 );
// Draw a rectangle
imagerectangle( $image, 0, 0, 50, 50 );
?>
--EXPECTF--
Warning: imagerectangle() expects exactly 6 parameters, %d given in %s on line %d

View File

@ -1,15 +0,0 @@
--TEST--
test imagesavealpha without arguments
--CREDITS--
Marcelo Diniz <marcelo.leo27 [at] gmail [dot] com
#phpspMaisTestFest PHPSP on 2014-07-05
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available.");
?>
--FILE--
<?php
imagesavealpha();
?>
--EXPECTF--
Warning: imagesavealpha() expects exactly 2 parameters, 0 given in %s on line %d

View File

@ -1,24 +0,0 @@
--TEST--
Testing imagetruecolortopalette(): wrong types for second parameter
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
if (!function_exists("imagecreatetruecolor")) die("skip GD Version not compatible");
?>
--FILE--
<?php
$image = imagecreatetruecolor(200, 100);
imagesetthickness($image, 's');
imagesetthickness($image, array());
imagesetthickness($image, $image);
?>
--EXPECTF--
Warning: imagesetthickness() expects parameter 2 to be int, string given in %s on line %d
Warning: imagesetthickness() expects parameter 2 to be int, array given in %s on line %d
Warning: imagesetthickness() expects parameter 2 to be int, resource given in %s on line %d

View File

@ -1,17 +0,0 @@
--TEST--
Testing error on non-resource parameter 1 of imagestring() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$result = imagestring('string', 1, 5, 5, 'String', 1);
?>
--EXPECTF--
Warning: imagestring() expects parameter 1 to be resource, %s given in %s on line %d

View File

@ -1,17 +0,0 @@
--TEST--
Testing error on non-long parameter 2 of imagestring() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
$result = imagestring($image, 'string', 5, 5, 'String', 1);
?>
--EXPECTF--
Warning: imagestring() expects parameter 2 to be int, %s given in %s on line %d

View File

@ -1,17 +0,0 @@
--TEST--
Testing error on non-long parameter 3 of imagestring() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
$result = imagestring($image, 1, 'string', 5, 'String', 1);
?>
--EXPECTF--
Warning: imagestring() expects parameter 3 to be int, %s given in %s on line %d

View File

@ -1,17 +0,0 @@
--TEST--
Testing error on non-long parameter 4 of imagestring() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
$result = imagestring($image, 1, 5, 'string', 'String', 1);
?>
--EXPECTF--
Warning: imagestring() expects parameter 4 to be int, %s given in %s on line %d

View File

@ -1,17 +0,0 @@
--TEST--
Testing error on non-string parameter 5 of imagestring() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
$result = imagestring($image, 1, 5, 5, $image, 1);
?>
--EXPECTF--
Warning: imagestring() expects parameter 5 to be string%S, %s given in %s on line %d

View File

@ -1,17 +0,0 @@
--TEST--
Testing error on non-long parameter 6 of imagestring() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
$result = imagestring($image, 1, 5, 5, 'String', 'font');
?>
--EXPECTF--
Warning: imagestring() expects parameter 6 to be int, %s given in %s on line %d

View File

@ -1,17 +0,0 @@
--TEST--
Testing error on non-resource parameter 1 of imagestringup() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$result = imagestringup('string', 1, 5, 5, 'String', 1);
?>
--EXPECTF--
Warning: imagestringup() expects parameter 1 to be resource, %s given in %s on line %d

View File

@ -1,17 +0,0 @@
--TEST--
Testing error on non-long parameter 2 of imagestringup() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
$result = imagestringup($image, 'string', 5, 5, 'String', 1);
?>
--EXPECTF--
Warning: imagestringup() expects parameter 2 to be int, %s given in %s on line %d

View File

@ -1,17 +0,0 @@
--TEST--
Testing error on non-long parameter 3 of imagestringup() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
$result = imagestringup($image, 1, 'string', 5, 'String', 1);
?>
--EXPECTF--
Warning: imagestringup() expects parameter 3 to be int, %s given in %s on line %d

View File

@ -1,17 +0,0 @@
--TEST--
Testing error on non-long parameter 4 of imagestringup() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
$result = imagestringup($image, 1, 5, 'string', 'String', 1);
?>
--EXPECTF--
Warning: imagestringup() expects parameter 4 to be int, %s given in %s on line %d

View File

@ -1,17 +0,0 @@
--TEST--
Testing error on non-string parameter 5 of imagestringup() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
$result = imagestringup($image, 1, 5, 5, $image, 1);
?>
--EXPECTF--
Warning: imagestringup() expects parameter 5 to be string%S, %s given in %s on line %d

View File

@ -1,17 +0,0 @@
--TEST--
Testing error on non-long parameter 6 of imagestringup() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
$result = imagestringup($image, 1, 5, 5, 'String', 'font');
?>
--EXPECTF--
Warning: imagestringup() expects parameter 6 to be int, %s given in %s on line %d

View File

@ -1,22 +0,0 @@
--TEST--
Testing imagetruecolortopalette(): wrong parameters for parameter 2
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
if (!function_exists("imagecreatetruecolor")) die("skip GD Version not compatible");
?>
--FILE--
<?php
$image = imagecreatetruecolor(50, 50);
$resource = tmpfile();
imagetruecolortopalette($image, $resource, 2);
imagetruecolortopalette($image, array(), 2);
?>
--EXPECTF--
Warning: imagetruecolortopalette() expects parameter 2 to be bool, resource given in %s on line %d
Warning: imagetruecolortopalette() expects parameter 2 to be bool, array given in %s on line %d

View File

@ -1,206 +0,0 @@
--TEST--
Test mb_convert_encoding() function : usage variations - pass different data types as $to_encoding arg
--SKIPIF--
<?php
extension_loaded('mbstring') or die('skip');
function_exists('mb_convert_encoding') or die("skip mb_convert_encoding() is not available in this build");
?>
--FILE--
<?php
/* Prototype : string mb_convert_encoding(string $str, string $to_encoding [, mixed $from_encoding])
* Description: Returns converted string in desired encoding
* Source code: ext/mbstring/mbstring.c
*/
/*
* Pass different data types to $to_encoding arg to test behaviour of mb_convert_encoding
*/
echo "*** Testing mb_convert_encoding() : usage variations ***\n";
// Initialise function arguments not being substituted
mb_internal_encoding('utf-8');
$sourcestring = 'hello, world';
//get an unset variable
$unset_var = 10;
unset ($unset_var);
// get a class
class classA
{
public function __toString() {
return "Class A object";
}
}
// heredoc string
$heredoc = <<<EOT
UTF-8
EOT;
// get a resource variable
$fp = fopen(__FILE__, "r");
// unexpected values to be passed to $to_encoding argument
$inputs = array(
// int data
/*1*/ 0,
1,
12345,
-2345,
// float data
/*5*/ 10.5,
-10.5,
12.3456789000e10,
12.3456789000E-10,
.5,
// null data
/*10*/ NULL,
null,
// boolean data
/*12*/ true,
false,
TRUE,
FALSE,
// empty data
/*16*/ "",
'',
// string data
/*18*/ "UTF-8",
'UTF-8',
$heredoc,
// object data
/*21*/ new classA(),
// undefined data
/*22*/ @$undefined_var,
// unset data
/*23*/ @$unset_var,
// resource variable
/*24*/ $fp
);
// loop through each element of $inputs to check the behaviour of mb_convert_encoding()
$iterator = 1;
foreach($inputs as $input) {
echo "\n-- Iteration $iterator --\n";
var_dump(bin2hex( mb_convert_encoding($sourcestring, $input, 'ISO-8859-1') ));
$iterator++;
};
fclose($fp);
echo "Done";
?>
--EXPECTF--
*** Testing mb_convert_encoding() : usage variations ***
-- Iteration 1 --
Warning: mb_convert_encoding(): Unknown encoding "0" in %s on line %d
string(0) ""
-- Iteration 2 --
Warning: mb_convert_encoding(): Unknown encoding "1" in %s on line %d
string(0) ""
-- Iteration 3 --
Warning: mb_convert_encoding(): Unknown encoding "12345" in %s on line %d
string(0) ""
-- Iteration 4 --
Warning: mb_convert_encoding(): Unknown encoding "-2345" in %s on line %d
string(0) ""
-- Iteration 5 --
Warning: mb_convert_encoding(): Unknown encoding "10.5" in %s on line %d
string(0) ""
-- Iteration 6 --
Warning: mb_convert_encoding(): Unknown encoding "-10.5" in %s on line %d
string(0) ""
-- Iteration 7 --
Warning: mb_convert_encoding(): Unknown encoding "123456789000" in %s on line %d
string(0) ""
-- Iteration 8 --
Warning: mb_convert_encoding(): Unknown encoding "1.23456789E-9" in %s on line %d
string(0) ""
-- Iteration 9 --
Warning: mb_convert_encoding(): Unknown encoding "0.5" in %s on line %d
string(0) ""
-- Iteration 10 --
string(24) "68656c6c6f2c20776f726c64"
-- Iteration 11 --
string(24) "68656c6c6f2c20776f726c64"
-- Iteration 12 --
Warning: mb_convert_encoding(): Unknown encoding "1" in %s on line %d
string(0) ""
-- Iteration 13 --
string(24) "68656c6c6f2c20776f726c64"
-- Iteration 14 --
Warning: mb_convert_encoding(): Unknown encoding "1" in %s on line %d
string(0) ""
-- Iteration 15 --
string(24) "68656c6c6f2c20776f726c64"
-- Iteration 16 --
string(24) "68656c6c6f2c20776f726c64"
-- Iteration 17 --
string(24) "68656c6c6f2c20776f726c64"
-- Iteration 18 --
string(24) "68656c6c6f2c20776f726c64"
-- Iteration 19 --
string(24) "68656c6c6f2c20776f726c64"
-- Iteration 20 --
string(24) "68656c6c6f2c20776f726c64"
-- Iteration 21 --
Warning: mb_convert_encoding(): Unknown encoding "Class A object" in %s on line %d
string(0) ""
-- Iteration 22 --
string(24) "68656c6c6f2c20776f726c64"
-- Iteration 23 --
string(24) "68656c6c6f2c20776f726c64"
-- Iteration 24 --
Warning: mb_convert_encoding() expects parameter 2 to be string, resource given in %s on line %d
string(0) ""
Done

View File

@ -1,236 +0,0 @@
--TEST--
Test mb_ereg() function : usage variations - pass different data types to $string arg
--SKIPIF--
<?php
extension_loaded('mbstring') or die('skip');
function_exists('mb_ereg') or die("skip mb_ereg() is not available in this build");
?>
--FILE--
<?php
/* Prototype : int mb_ereg(string $pattern, string $string [, array $registers])
* Description: Regular expression match for multibyte string
* Source code: ext/mbstring/php_mbregex.c
*/
/*
* Test behaviour of mb_ereg() when passed different data types as $string arg
*/
echo "*** Testing mb_ereg() : usage variations ***\n";
// Initialise function arguments not being substituted
$pattern = 'str';
//get an unset variable
$unset_var = 10;
unset ($unset_var);
// get a class
class classA
{
public function __toString() {
return "Class A object";
}
}
// heredoc string
$heredoc = <<<EOT
hello world
EOT;
// get a resource variable
$fp = fopen(__FILE__, "r");
// unexpected values to be passed to $string argument
$inputs = array(
// int data
/*1*/ 0,
1,
12345,
-2345,
// float data
/*5*/ 10.5,
-10.5,
12.3456789000e10,
12.3456789000E-10,
.5,
// null data
/*10*/ NULL,
null,
// boolean data
/*12*/ true,
false,
TRUE,
FALSE,
// empty data
/*16*/ "",
'',
// string data
/*18*/ "string",
'string',
$heredoc,
// object data
/*21*/ new classA(),
// undefined data
/*22*/ @$undefined_var,
// unset data
/*23*/ @$unset_var,
// resource variable
/*24*/ $fp
);
// loop through each element of $inputs to check the behavior of mb_ereg()
$iterator = 1;
foreach($inputs as $input) {
if (@is_array($regs)){
$regs = null;
}
echo "\n-- Iteration $iterator --\n";
var_dump( mb_ereg($pattern, $input, $regs) );
var_dump($regs);
$iterator++;
};
fclose($fp);
echo "Done";
?>
--EXPECTF--
*** Testing mb_ereg() : usage variations ***
-- Iteration 1 --
bool(false)
array(0) {
}
-- Iteration 2 --
bool(false)
array(0) {
}
-- Iteration 3 --
bool(false)
array(0) {
}
-- Iteration 4 --
bool(false)
array(0) {
}
-- Iteration 5 --
bool(false)
array(0) {
}
-- Iteration 6 --
bool(false)
array(0) {
}
-- Iteration 7 --
bool(false)
array(0) {
}
-- Iteration 8 --
bool(false)
array(0) {
}
-- Iteration 9 --
bool(false)
array(0) {
}
-- Iteration 10 --
bool(false)
array(0) {
}
-- Iteration 11 --
bool(false)
array(0) {
}
-- Iteration 12 --
bool(false)
array(0) {
}
-- Iteration 13 --
bool(false)
array(0) {
}
-- Iteration 14 --
bool(false)
array(0) {
}
-- Iteration 15 --
bool(false)
array(0) {
}
-- Iteration 16 --
bool(false)
array(0) {
}
-- Iteration 17 --
bool(false)
array(0) {
}
-- Iteration 18 --
int(3)
array(1) {
[0]=>
string(3) "str"
}
-- Iteration 19 --
int(3)
array(1) {
[0]=>
string(3) "str"
}
-- Iteration 20 --
bool(false)
array(0) {
}
-- Iteration 21 --
bool(false)
array(0) {
}
-- Iteration 22 --
bool(false)
array(0) {
}
-- Iteration 23 --
bool(false)
array(0) {
}
-- Iteration 24 --
Warning: mb_ereg() expects parameter 2 to be string, resource given in %s on line %d
bool(false)
NULL
Done

View File

@ -1,36 +0,0 @@
--TEST--
Test mb_internal_encoding() function : error conditions - pass incorrect number of args
--SKIPIF--
<?php
extension_loaded('mbstring') or die('skip');
function_exists('mb_internal_encoding') or die("skip mb_internal_encoding() is not available in this build");
?>
--FILE--
<?php
/* Prototype : string mb_internal_encoding([string $encoding])
* Description: Sets the current internal encoding or
* Returns the current internal encoding as a string
* Source code: ext/mbstring/mbstring.c
*/
/*
* Test mb_internal_encoding with one more than the expected number of arguments
*/
echo "*** Testing mb_internal_encoding() : error conditions ***\n";
echo "\n-- Testing mb_internal_encoding() function with more than expected no. of arguments --\n";
$encoding = 'string_val';
$extra_arg = 10;
var_dump( mb_internal_encoding($encoding, $extra_arg) );
echo "Done";
?>
--EXPECTF--
*** Testing mb_internal_encoding() : error conditions ***
-- Testing mb_internal_encoding() function with more than expected no. of arguments --
Warning: mb_internal_encoding() expects at most 1 parameter, 2 given in %s on line %d
NULL
Done

View File

@ -1,50 +0,0 @@
--TEST--
Test mb_split() function : error conditions
--SKIPIF--
<?php
extension_loaded('mbstring') or die('skip');
function_exists('mb_split') or die("skip mb_split() is not available in this build");
?>
--FILE--
<?php
/* Prototype : proto array mb_split(string pattern, string string [, int limit])
* Description: split multibyte string into array by regular expression
* Source code: ext/mbstring/php_mbregex.c
* Alias to functions:
*/
/*
* test too few and too many parameters
*/
echo "*** Testing mb_split() : error conditions ***\n";
//Test mb_split with one more than the expected number of arguments
echo "\n-- Testing mb_split() function with more than expected no. of arguments --\n";
$pattern = ' ';
$string = 'a b c d e f g';
$limit = 0;
$extra_arg = 10;
var_dump( mb_split($pattern, $string, $limit, $extra_arg) );
// Testing mb_split with one less than the expected number of arguments
echo "\n-- Testing mb_split() function with less than expected no. of arguments --\n";
$pattern = 'string_val';
var_dump( mb_split($pattern) );
echo "Done";
?>
--EXPECTF--
*** Testing mb_split() : error conditions ***
-- Testing mb_split() function with more than expected no. of arguments --
Warning: mb_split() expects at most 3 parameters, 4 given in %s on line %d
bool(false)
-- Testing mb_split() function with less than expected no. of arguments --
Warning: mb_split() expects at least 2 parameters, 1 given in %s on line %d
bool(false)
Done

View File

@ -1,47 +0,0 @@
--TEST--
Test mb_strrchr() function : error conditions
--SKIPIF--
<?php
extension_loaded('mbstring') or die('skip');
function_exists('mb_strrchr') or die("skip mb_strrchr() is not available in this build");
?>
--FILE--
<?php
/* Prototype : string mb_strrchr(string haystack, string needle[, bool part[, string encoding]])
* Description: Finds the last occurrence of a character in a string within another
* Source code: ext/mbstring/mbstring.c
* Alias to functions:
*/
echo "*** Testing mb_strrchr() : error conditions ***\n";
//Test mb_strrchr with one more than the expected number of arguments
echo "\n-- Testing mb_strrchr() function with more than expected no. of arguments --\n";
$haystack = 'string_val';
$needle = 'string_val';
$part = true;
$encoding = 'string_val';
$extra_arg = 10;
var_dump( mb_strrchr($haystack, $needle, $part, $encoding, $extra_arg) );
// Testing mb_strrchr with one less than the expected number of arguments
echo "\n-- Testing mb_strrchr() function with less than expected no. of arguments --\n";
$haystack = 'string_val';
var_dump( mb_strrchr($haystack) );
?>
===DONE===
--EXPECTF--
*** Testing mb_strrchr() : error conditions ***
-- Testing mb_strrchr() function with more than expected no. of arguments --
Warning: mb_strrchr() expects at most 4 parameters, 5 given in %s on line %d
NULL
-- Testing mb_strrchr() function with less than expected no. of arguments --
Warning: mb_strrchr() expects at least 2 parameters, 1 given in %s on line %d
NULL
===DONE===

View File

@ -1,46 +0,0 @@
--TEST--
Test mb_strtolower() function : error conditions - pass incorrect number of arguments
--SKIPIF--
<?php
extension_loaded('mbstring') or die('skip');
function_exists('mb_strtolower') or die("skip mb_strtolower() is not available in this build");
?>
--FILE--
<?php
/* Prototype : string mb_strtolower(string $sourcestring [, string $encoding])
* Description: Returns a lowercased version of $sourcestring
* Source code: ext/mbstring/mbstring.c
*/
/*
* Pass an incorrect number of arguments to mb_strtolower() to test behaviour
*/
echo "*** Testing mb_strtolower() : error conditions***\n";
//Test mb_strtolower with one more than the expected number of arguments
echo "\n-- Testing mb_strtolower() function with more than expected no. of arguments --\n";
$sourcestring = 'string_value';
$encoding = 'UTF-8';
$extra_arg = 10;
var_dump( mb_strtolower($sourcestring, $encoding, $extra_arg) );
//Test mb_strtolower with zero arguments
echo "\n-- Testing mb_strtolower() function with zero arguments --\n";
var_dump( mb_strtolower() );
echo "Done";
?>
--EXPECTF--
*** Testing mb_strtolower() : error conditions***
-- Testing mb_strtolower() function with more than expected no. of arguments --
Warning: mb_strtolower() expects at most 2 parameters, 3 given in %s on line %d
NULL
-- Testing mb_strtolower() function with zero arguments --
Warning: mb_strtolower() expects at least 1 parameter, 0 given in %s on line %d
NULL
Done

View File

@ -1,46 +0,0 @@
--TEST--
Test mb_strtoupper() function : error conditions - pass incorrect number of args
--SKIPIF--
<?php
extension_loaded('mbstring') or die('skip');
function_exists('mb_strtoupper') or die("skip mb_strtoupper() is not available in this build");
?>
--FILE--
<?php
/* Prototype : string mb_strtoupper(string $sourcestring [, string $encoding]
* Description: Returns a uppercased version of $sourcestring
* Source code: ext/mbstring/mbstring.c
*/
/*
* Pass an incorrect number of arguments to mb_strtoupper() to test behaviour
*/
echo "*** Testing mb_strtoupper() : error conditions ***\n";
//Test mb_strtoupper with one more than the expected number of arguments
echo "\n-- Testing mb_strtoupper() function with more than expected no. of arguments --\n";
$sourcestring = 'string_value';
$encoding = 'UTF-8';
$extra_arg = 10;
var_dump( mb_strtoupper($sourcestring, $encoding, $extra_arg) );
//Test mb_strtoupper with zero arguments
echo "\n-- Testing mb_strtoupper() function with zero arguments --\n";
var_dump( mb_strtoupper() );
echo "Done";
?>
--EXPECTF--
*** Testing mb_strtoupper() : error conditions ***
-- Testing mb_strtoupper() function with more than expected no. of arguments --
Warning: mb_strtoupper() expects at most 2 parameters, 3 given in %s on line %d
NULL
-- Testing mb_strtoupper() function with zero arguments --
Warning: mb_strtoupper() expects at least 1 parameter, 0 given in %s on line %d
NULL
Done

View File

@ -1,34 +0,0 @@
--TEST--
Test mb_substitute_character() function : error conditions
--SKIPIF--
<?php
extension_loaded('mbstring') or die('skip');
function_exists('mb_substitute_character') or die("skip mb_substitute_character() is not available in this build");
?>
--FILE--
<?php
/* Prototype : mixed mb_substitute_character([mixed substchar])
* Description: Sets the current substitute_character or returns the current substitute_character
* Source code: ext/mbstring/mbstring.c
* Alias to functions:
*/
echo "*** Testing mb_substitute_character() : error conditions ***\n";
//Test mb_substitute_character with one more than the expected number of arguments
echo "\n-- Testing mb_substitute_character() function with more than expected no. of arguments --\n";
$substchar = 1;
$extra_arg = 10;
var_dump( mb_substitute_character($substchar, $extra_arg) );
?>
===DONE===
--EXPECTF--
*** Testing mb_substitute_character() : error conditions ***
-- Testing mb_substitute_character() function with more than expected no. of arguments --
Warning: mb_substitute_character() expects at most 1 parameter, 2 given in %s on line %d
NULL
===DONE===

View File

@ -1,49 +0,0 @@
--TEST--
Test mb_substr_count() function : error conditions - pass incorrect number of arguments
--SKIPIF--
<?php
extension_loaded('mbstring') or die('skip');
function_exists('mb_substr_count') or die("skip mb_substr_count() is not available in this build");
?>
--FILE--
<?php
/* Prototype : int mb_substr_count(string $haystack, string $needle [, string $encoding])
* Description: Count the number of substring occurrences
* Source code: ext/mbstring/mbstring.c
*/
/*
* Pass an incorrect number of arguments to mb_substr_count() to test behaviour
*/
echo "*** Testing mb_substr_count() : error conditions ***\n";
//Test mb_substr_count with one more than the expected number of arguments
echo "\n-- Testing mb_substr_count() function with more than expected no. of arguments --\n";
$haystack = 'string_val';
$needle = 'val';
$encoding = 'utf-8';
$extra_arg = 10;
var_dump( mb_substr_count($haystack, $needle, $encoding, $extra_arg) );
// Testing mb_substr_count with one less than the expected number of arguments
echo "\n-- Testing mb_substr_count() function with less than expected no. of arguments --\n";
$haystack = 'string_val';
var_dump( mb_substr_count($haystack) );
echo "Done";
?>
--EXPECTF--
*** Testing mb_substr_count() : error conditions ***
-- Testing mb_substr_count() function with more than expected no. of arguments --
Warning: mb_substr_count() expects at most 3 parameters, 4 given in %s on line %d
NULL
-- Testing mb_substr_count() function with less than expected no. of arguments --
Warning: mb_substr_count() expects at least 2 parameters, 1 given in %s on line %d
NULL
Done

View File

@ -1,49 +0,0 @@
--TEST--
Test mb_substr() function : error conditions - Pass incorrect number of args
--SKIPIF--
<?php
extension_loaded('mbstring') or die('skip');
function_exists('mb_substr') or die("skip mb_substr() is not available in this build");
?>
--FILE--
<?php
/* Prototype : string mb_substr(string $str, int $start [, int $length [, string $encoding]])
* Description: Returns part of a string
* Source code: ext/mbstring/mbstring.c
*/
/*
* Pass incorrect number of arguments to mb_substr() to test behaviour
*/
echo "*** Testing mb_substr() : error conditions ***\n";
//Test mb_substr with one more than the expected number of arguments
echo "\n-- Testing mb_substr() function with more than expected no. of arguments --\n";
$str = 'string_val';
$start = 10;
$length = 10;
$encoding = 'string_val';
$extra_arg = 10;
var_dump( mb_substr($str, $start, $length, $encoding, $extra_arg) );
// Testing mb_substr with one less than the expected number of arguments
echo "\n-- Testing mb_substr() function with less than expected no. of arguments --\n";
$str = 'string_val';
var_dump( mb_substr($str) );
echo "Done";
?>
--EXPECTF--
*** Testing mb_substr() : error conditions ***
-- Testing mb_substr() function with more than expected no. of arguments --
Warning: mb_substr() expects at most 4 parameters, 5 given in %s on line %d
NULL
-- Testing mb_substr() function with less than expected no. of arguments --
Warning: mb_substr() expects at least 2 parameters, 1 given in %s on line %d
NULL
Done