diff options
Diffstat (limited to 'ext/standard/tests/strings')
55 files changed, 0 insertions, 2648 deletions
diff --git a/ext/standard/tests/strings/addcslashes_004.phpt b/ext/standard/tests/strings/addcslashes_004.phpt deleted file mode 100644 index a787845506..0000000000 --- a/ext/standard/tests/strings/addcslashes_004.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Test addcslashes() function (errors) ---INI-- -precision=14 ---FILE-- -<?php - -echo "\n*** Testing error conditions ***\n"; -/* zero argument */ -var_dump( addcslashes() ); - -/* unexpected arguments */ -var_dump( addcslashes("foo[]") ); -var_dump( addcslashes('foo[]', "o", "foo") ); - -echo "Done\n"; - -?> ---EXPECTF-- -*** Testing error conditions *** - -Warning: addcslashes() expects exactly 2 parameters, 0 given in %s on line %d -NULL - -Warning: addcslashes() expects exactly 2 parameters, 1 given in %s on line %d -NULL - -Warning: addcslashes() expects exactly 2 parameters, 3 given in %s on line %d -NULL -Done diff --git a/ext/standard/tests/strings/addslashes_error.phpt b/ext/standard/tests/strings/addslashes_error.phpt deleted file mode 100644 index c5d67c09ae..0000000000 --- a/ext/standard/tests/strings/addslashes_error.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Test addslashes() function : error conditions ---FILE-- -<?php -/* Prototype : string addslashes ( string $str ) - * Description: Returns a string with backslashes before characters that need to be quoted in database queries etc. - * Source code: ext/standard/string.c -*/ - -/* - * Testing addslashes() for error conditions -*/ - -echo "*** Testing addslashes() : error conditions ***\n"; - -// Zero argument -echo "\n-- Testing addslashes() function with Zero arguments --\n"; -var_dump( addslashes() ); - -// More than expected number of arguments -echo "\n-- Testing addslashes() function with more than expected no. of arguments --\n"; -$str = '"hello"\"world"'; -$extra_arg = 10; - -var_dump( addslashes($str, $extra_arg) ); -var_dump( $str ); - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing addslashes() : error conditions *** - --- Testing addslashes() function with Zero arguments -- - -Warning: addslashes() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing addslashes() function with more than expected no. of arguments -- - -Warning: addslashes() expects exactly 1 parameter, 2 given in %s on line %d -NULL -string(15) ""hello"\"world"" -Done diff --git a/ext/standard/tests/strings/basename_error.phpt b/ext/standard/tests/strings/basename_error.phpt deleted file mode 100644 index 8309c3578b..0000000000 --- a/ext/standard/tests/strings/basename_error.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -Test basename() function : error conditions ---FILE-- -<?php -/* Prototype: string basename ( string $path [, string $suffix] ); - Description: Given a string containing a path to a file, - this function will return the base name of the file. - If the filename ends in suffix this will also be cut off. -*/ -echo "*** Testing error conditions ***\n"; -// zero arguments -var_dump( basename() ); - -// more than expected no. of arguments -var_dump( basename("/var/tmp/bar.gz", ".gz", ".gz") ); - -// passing invalid type arguments -$object = new stdclass; -var_dump( basename( array("string/bar") ) ); -var_dump( basename( array("string/bar"), "bar" ) ); -var_dump( basename( "bar", array("string/bar") ) ); -var_dump( basename( $object, "bar" ) ); -var_dump( basename( $object ) ); -var_dump( basename( $object, $object ) ); -var_dump( basename( "bar", $object ) ); - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing error conditions *** - -Warning: basename() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: basename() expects at most 2 parameters, 3 given in %s on line %d -NULL - -Warning: basename() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: basename() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: basename() expects parameter 2 to be string, array given in %s on line %d -NULL - -Warning: basename() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: basename() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: basename() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: basename() expects parameter 2 to be string, object given in %s on line %d -NULL -Done diff --git a/ext/standard/tests/strings/bin2hex_error.phpt b/ext/standard/tests/strings/bin2hex_error.phpt deleted file mode 100644 index efee90bdee..0000000000 --- a/ext/standard/tests/strings/bin2hex_error.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Test bin2hex() function : error conditions ---FILE-- -<?php - -/* Prototype : string bin2hex ( string $str ) - * Description: Convert binary data into hexadecimal representation - * Source code: ext/standard/string.c -*/ - -echo "*** Testing bin2hex() : error conditions ***\n"; - -echo "\n-- Testing bin2hex() function with no arguments --\n"; -var_dump( bin2hex() ); - -echo "\n-- Testing bin2hex() function with more than expected no. of arguments --\n"; -$extra_arg = 10; -var_dump( bin2hex("Hello World", $extra_arg) ); - -?> -===DONE=== ---EXPECTF-- -*** Testing bin2hex() : error conditions *** - --- Testing bin2hex() function with no arguments -- - -Warning: bin2hex() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing bin2hex() function with more than expected no. of arguments -- - -Warning: bin2hex() expects exactly 1 parameter, 2 given in %s on line %d -NULL -===DONE=== diff --git a/ext/standard/tests/strings/chop_error.phpt b/ext/standard/tests/strings/chop_error.phpt deleted file mode 100644 index 2f2656f3aa..0000000000 --- a/ext/standard/tests/strings/chop_error.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -Test chop() function : error conditions ---FILE-- -<?php -/* Prototype : string chop ( string $str [, string $charlist] ) - * Description: Strip whitespace (or other characters) from the end of a string - * Source code: ext/standard/string.c -*/ - -/* - * Testing chop() : error conditions -*/ - -echo "*** Testing chop() : error conditions ***\n"; - -// Zero argument -echo "\n-- Testing chop() function with Zero arguments --\n"; -var_dump( chop() ); - -// More than expected number of arguments -echo "\n-- Testing chop() function with more than expected no. of arguments --\n"; -$str = 'string_val '; -$charlist = 'string_val'; -$extra_arg = 10; - -var_dump( chop($str, $charlist, $extra_arg) ); -var_dump( $str ); - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing chop() : error conditions *** - --- Testing chop() function with Zero arguments -- - -Warning: chop() expects at least 1 parameter, 0 given in %s on line %d -NULL - --- Testing chop() function with more than expected no. of arguments -- - -Warning: chop() expects at most 2 parameters, 3 given in %s on line %d -NULL -string(11) "string_val " -Done diff --git a/ext/standard/tests/strings/chunk_split_error.phpt b/ext/standard/tests/strings/chunk_split_error.phpt deleted file mode 100644 index d8a72586af..0000000000 --- a/ext/standard/tests/strings/chunk_split_error.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Test chunk_split() function : error conditions ---FILE-- -<?php -/* Prototype : string chunk_split(string $str [, int $chunklen [, string $ending]]) - * Description: Returns split line - * Source code: ext/standard/string.c - * Alias to functions: none -*/ - -/* -* Testing error conditions of chunk_split() with zero arguments -* and for more than expected number of arguments -*/ - -echo "*** Testing chunk_split() : error conditions ***\n"; - -// Zero arguments -echo "-- Testing chunk_split() function with Zero arguments --"; -var_dump( chunk_split() ); - -// With one more than the expected number of arguments -$str = 'Testing chunk_split'; -$chunklen = 5; -$ending = '***'; -$extra_arg = 10; -echo "-- Testing chunk_split() function with more than expected no. of arguments --"; -var_dump( chunk_split($str, $chunklen, $ending, $extra_arg) ); - -echo "Done" -?> ---EXPECTF-- -*** Testing chunk_split() : error conditions *** --- Testing chunk_split() function with Zero arguments -- -Warning: chunk_split() expects at least 1 parameter, 0 given in %s on line %d -NULL --- Testing chunk_split() function with more than expected no. of arguments -- -Warning: chunk_split() expects at most 3 parameters, 4 given in %s on line %d -NULL -Done diff --git a/ext/standard/tests/strings/convert_uudecode_error.phpt b/ext/standard/tests/strings/convert_uudecode_error.phpt deleted file mode 100644 index 77ac18b50b..0000000000 --- a/ext/standard/tests/strings/convert_uudecode_error.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Test convert_uudecode() function : error conditions ---FILE-- -<?php - -/* Prototype : string convert_uudecode ( string $data ) - * Description: Decode a uuencoded string - * Source code: ext/standard/uuencode.c -*/ - -echo "*** Testing convert_uudecode() : error conditions ***\n"; - -echo "\n-- Testing convert_uudecode() function with no arguments --\n"; -var_dump( convert_uudecode() ); - -echo "\n-- Testing convert_uudecode() function with more than expected no. of arguments --\n"; -$extra_arg = 10; -var_dump( convert_uudecode(72, $extra_arg) ); - -?> -===DONE=== ---EXPECTF-- -*** Testing convert_uudecode() : error conditions *** - --- Testing convert_uudecode() function with no arguments -- - -Warning: convert_uudecode() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - --- Testing convert_uudecode() function with more than expected no. of arguments -- - -Warning: convert_uudecode() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) -===DONE=== diff --git a/ext/standard/tests/strings/convert_uuencode_error.phpt b/ext/standard/tests/strings/convert_uuencode_error.phpt deleted file mode 100644 index ec4d3f6477..0000000000 --- a/ext/standard/tests/strings/convert_uuencode_error.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Test convert_uuencode() function : error conditions ---FILE-- -<?php - -/* Prototype : string convert_uuencode ( string $data ) - * Description: Uuencode a string - * Source code: ext/standard/uuencode.c -*/ - -echo "*** Testing convert_uuencode() : error conditions ***\n"; - -echo "\n-- Testing chconvert_uuencoder() function with no arguments --\n"; -var_dump( convert_uuencode() ); - -echo "\n-- Testing convert_uuencode() function with more than expected no. of arguments --\n"; -$extra_arg = 10; -var_dump( convert_uuencode(72, $extra_arg) ); - -?> -===DONE=== ---EXPECTF-- -*** Testing convert_uuencode() : error conditions *** - --- Testing chconvert_uuencoder() function with no arguments -- - -Warning: convert_uuencode() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - --- Testing convert_uuencode() function with more than expected no. of arguments -- - -Warning: convert_uuencode() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) -===DONE=== diff --git a/ext/standard/tests/strings/count_chars_error.phpt b/ext/standard/tests/strings/count_chars_error.phpt deleted file mode 100644 index f87b6e532e..0000000000 --- a/ext/standard/tests/strings/count_chars_error.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Test count_chars() function : error conditions ---FILE-- -<?php - -/* Prototype : mixed count_chars ( string $string [, int $mode ] ) - * Description: Return information about characters used in a string - * Source code: ext/standard/string.c -*/ - -echo "*** Testing count_chars() : error conditions ***\n"; - -echo "\n-- Testing count_chars() function with no arguments --\n"; -var_dump( count_chars() ); - -echo "\n-- Testing count_chars() function with more than expected no. of arguments --\n"; -$string = "Hello World\n"; -$mode = 1; -$extra_arg = 10; -var_dump( count_chars($string, $mode, $extra_arg) ); - -?> -===DONE=== ---EXPECTF-- -*** Testing count_chars() : error conditions *** - --- Testing count_chars() function with no arguments -- - -Warning: count_chars() expects at least 1 parameter, 0 given in %s on line %d -NULL - --- Testing count_chars() function with more than expected no. of arguments -- - -Warning: count_chars() expects at most 2 parameters, 3 given in %s on line %d -NULL -===DONE=== diff --git a/ext/standard/tests/strings/crc32_error.phpt b/ext/standard/tests/strings/crc32_error.phpt deleted file mode 100644 index 98680cde34..0000000000 --- a/ext/standard/tests/strings/crc32_error.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Test crc32() function : error conditions ---FILE-- -<?php -/* Prototype : string crc32(string $str) - * Description: Calculate the crc32 polynomial of a string - * Source code: ext/standard/crc32.c - * Alias to functions: none -*/ - -/* - * Testing crc32() : error conditions -*/ - -echo "*** Testing crc32() : error conditions ***\n"; - -// Zero arguments -echo "\n-- Testing crc32() function with Zero arguments --\n"; -var_dump( crc32() ); - -//Test crc32 with one more than the expected number of arguments -echo "\n-- Testing crc32() function with more than expected no. of arguments --\n"; -$str = 'string_val'; -$extra_arg = 10; -var_dump( crc32($str, $extra_arg) ); - -echo "Done"; -?> ---EXPECTF-- -*** Testing crc32() : error conditions *** - --- Testing crc32() function with Zero arguments -- - -Warning: crc32() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing crc32() function with more than expected no. of arguments -- - -Warning: crc32() expects exactly 1 parameter, 2 given in %s on line %d -NULL -Done diff --git a/ext/standard/tests/strings/explode_error.phpt b/ext/standard/tests/strings/explode_error.phpt deleted file mode 100644 index d86e1edb1f..0000000000 --- a/ext/standard/tests/strings/explode_error.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Test explode() function : error conditions ---FILE-- -<?php - -/* Prototype : array explode ( string $delimiter , string $string [, int $limit ] ) - * Description: Split a string by string. - * Source code: ext/standard/string.c -*/ - -echo "*** Testing explode() : error conditions ***\n"; - -echo "\n-- Testing explode() function with no arguments --\n"; -var_dump( explode() ); - -echo "\n-- Testing explode() function with more than expected no. of arguments --\n"; -$delimiter = " "; -$string = "piece1 piece2 piece3 piece4 piece5 piece6"; -$limit = 5; -$extra_arg = 10; -var_dump( explode($delimiter, $string, $limit, $extra_arg) ); - -?> -===Done=== ---EXPECTF-- -*** Testing explode() : error conditions *** - --- Testing explode() function with no arguments -- - -Warning: explode() expects at least 2 parameters, 0 given in %s on line %d -NULL - --- Testing explode() function with more than expected no. of arguments -- - -Warning: explode() expects at most 3 parameters, 4 given in %s on line %d -NULL -===Done=== diff --git a/ext/standard/tests/strings/get_html_translation_table_error.phpt b/ext/standard/tests/strings/get_html_translation_table_error.phpt deleted file mode 100644 index 5adfe98478..0000000000 --- a/ext/standard/tests/strings/get_html_translation_table_error.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Test get_html_translation_table() function : error conditions ---FILE-- -<?php -/* Prototype : array get_html_translation_table ( [int $table [, int $quote_style [, string charset_hint]]] ) - * Description: Returns the internal translation table used by htmlspecialchars and htmlentities - * Source code: ext/standard/html.c -*/ - -echo "*** Testing get_html_translation_table() : error conditions ***\n"; - -// More than expected number of arguments -echo "\n-- Testing get_html_translation_table() function with more than expected no. of arguments --\n"; -$table = HTML_ENTITIES; -$quote_style = ENT_COMPAT; -$extra_arg = 10; - -var_dump( get_html_translation_table($table, $quote_style, "UTF-8", $extra_arg) ); - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing get_html_translation_table() : error conditions *** - --- Testing get_html_translation_table() function with more than expected no. of arguments -- - -Warning: get_html_translation_table() expects at most 3 parameters, 4 given in %s on line %d -NULL -Done diff --git a/ext/standard/tests/strings/hebrev_error.phpt b/ext/standard/tests/strings/hebrev_error.phpt deleted file mode 100644 index a04e519db5..0000000000 --- a/ext/standard/tests/strings/hebrev_error.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Test hebrev() function : error conditions ---FILE-- -<?php - -/* Prototype : string hebrev ( string $hebrew_text [, int $max_chars_per_line ] ) - * Description: Convert logical Hebrew text to visual text - * Source code: ext/standard/string.c -*/ - -echo "*** Testing hebrev() : error conditions ***\n"; - -echo "\n-- Testing hebrev() function with no arguments --\n"; -var_dump( hebrev() ); - -echo "\n-- Testing hebrev() function with more than expected no. of arguments --\n"; -$extra_arg = 10; -var_dump( hebrev("Hello World", 5, $extra_arg) ); - -?> -===DONE=== ---EXPECTF-- -*** Testing hebrev() : error conditions *** - --- Testing hebrev() function with no arguments -- - -Warning: hebrev() expects at least 1 parameter, 0 given in %s on line %d -NULL - --- Testing hebrev() function with more than expected no. of arguments -- - -Warning: hebrev() expects at most 2 parameters, 3 given in %s on line %d -NULL -===DONE=== diff --git a/ext/standard/tests/strings/hebrevc_error.phpt b/ext/standard/tests/strings/hebrevc_error.phpt deleted file mode 100644 index 630c995b18..0000000000 --- a/ext/standard/tests/strings/hebrevc_error.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Test hebrevc() function : error conditions ---FILE-- -<?php - -/* Prototype : string hebrevc ( string $hebrew_text [, int $max_chars_per_line ] ) - * Description: Convert logical Hebrew text to visual text - * Source code: ext/standard/string.c -*/ - -echo "*** Testing hebrevc() : error conditions ***\n"; - -echo "\n-- Testing hebrevc() function with no arguments --\n"; -var_dump( hebrevc() ); - -echo "\n-- Testing hebrevc() function with more than expected no. of arguments --\n"; -$extra_arg = 10; -var_dump( hebrevc("Hello World", 5, $extra_arg) ); - -?> -===DONE=== ---EXPECTF-- -*** Testing hebrevc() : error conditions *** - --- Testing hebrevc() function with no arguments -- - -Warning: hebrevc() expects at least 1 parameter, 0 given in %s on line %d -NULL - --- Testing hebrevc() function with more than expected no. of arguments -- - -Warning: hebrevc() expects at most 2 parameters, 3 given in %s on line %d -NULL -===DONE=== diff --git a/ext/standard/tests/strings/htmlspecialchars_decode_error.phpt b/ext/standard/tests/strings/htmlspecialchars_decode_error.phpt deleted file mode 100644 index 36b8e6bbec..0000000000 --- a/ext/standard/tests/strings/htmlspecialchars_decode_error.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Test htmlspecialchars_decode() function : error conditions ---FILE-- -<?php -/* Prototype : string htmlspecialchars_decode(string $string [, int $quote_style]) - * Description: Convert special HTML entities back to characters - * Source code: ext/standard/html.c -*/ - -echo "*** Testing htmlspecialchars_decode() : error conditions ***\n"; - -// Zero arguments -echo "\n-- Testing htmlspecialchars_decode() function with Zero arguments --\n"; -var_dump( htmlspecialchars_decode() ); - -//Test htmlspecialchars_decode with one more than the expected number of arguments -echo "\n-- Testing htmlspecialchars_decode() function with more than expected no. of arguments --\n"; -$string = "<html>hello & > < " ' world</html>"; -$quote_style = ENT_COMPAT; -$extra_arg = 10; -var_dump( htmlspecialchars_decode($string, $quote_style, $extra_arg) ); - -echo "Done"; -?> ---EXPECTF-- -*** Testing htmlspecialchars_decode() : error conditions *** - --- Testing htmlspecialchars_decode() function with Zero arguments -- - -Warning: htmlspecialchars_decode() expects at least 1 parameter, 0 given in %s on line %d -NULL - --- Testing htmlspecialchars_decode() function with more than expected no. of arguments -- - -Warning: htmlspecialchars_decode() expects at most 2 parameters, 3 given in %s on line %d -NULL -Done diff --git a/ext/standard/tests/strings/http_build_query_error.phpt b/ext/standard/tests/strings/http_build_query_error.phpt deleted file mode 100644 index 2975d2d723..0000000000 --- a/ext/standard/tests/strings/http_build_query_error.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Testing error on null parameter 1 of http_build_query() ---CREDITS-- -Pawel Krynicki <pawel.krynicki [at] xsolve [dot] pl> -#testfest AmsterdamPHP 2012-06-23 ---FILE-- -<?php - -$result = http_build_query(null); - -?> ---EXPECTF-- -Warning: http_build_query() expects parameter 1 to be array, null given in %s on line %d diff --git a/ext/standard/tests/strings/md5_error.phpt b/ext/standard/tests/strings/md5_error.phpt deleted file mode 100644 index 138df1b8bd..0000000000 --- a/ext/standard/tests/strings/md5_error.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -Test md5() function : error conditions ---FILE-- -<?php -/* Prototype : string md5 ( string $str [, bool $raw_output= false ] ) - * Description: Calculate the md5 hash of a string - * Source code: ext/standard/md5.c -*/ - -echo "*** Testing md5() : error conditions ***\n"; - -echo "\n-- Testing md5() function with no arguments --\n"; -var_dump( md5()); - -echo "\n-- Testing md5() function with more than expected no. of arguments --\n"; -$str = "Hello World"; -$raw_output = true; -$extra_arg = 10; - -var_dump(md5($str, $raw_output, $extra_arg)); -?> -===DONE== ---EXPECTF-- -*** Testing md5() : error conditions *** - --- Testing md5() function with no arguments -- - -Warning: md5() expects at least 1 parameter, 0 given in %s on line %d -NULL - --- Testing md5() function with more than expected no. of arguments -- - -Warning: md5() expects at most 2 parameters, 3 given in %s on line %d -NULL -===DONE== diff --git a/ext/standard/tests/strings/nl2br_error.phpt b/ext/standard/tests/strings/nl2br_error.phpt deleted file mode 100644 index b40e7b16a5..0000000000 --- a/ext/standard/tests/strings/nl2br_error.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Test nl2br() function : error conditions ---FILE-- -<?php -/* Prototype : string nl2br(string $str) - * Description: Inserts HTML line breaks before all newlines in a string. - * Source code: ext/standard/string.c -*/ - -echo "*** Testing nl2br() : error conditions ***\n"; - -// Zero arguments -echo "\n-- Testing nl2br() function with Zero arguments --"; -var_dump( nl2br() ); - -//Test nl2br with one more than the expected number of arguments -echo "\n-- Testing nl2br() function with more than expected no. of arguments --"; -$str = 'string_val'; -$extra_arg = 10; -var_dump( nl2br($str, true, $extra_arg) ); - -echo "Done"; -?> ---EXPECTF-- -*** Testing nl2br() : error conditions *** - --- Testing nl2br() function with Zero arguments -- -Warning: nl2br() expects at least 1 parameter, 0 given in %s on line %d -NULL - --- Testing nl2br() function with more than expected no. of arguments -- -Warning: nl2br() expects at most 2 parameters, 3 given in %s on line %d -NULL -Done diff --git a/ext/standard/tests/strings/nl_langinfo_error1.phpt b/ext/standard/tests/strings/nl_langinfo_error1.phpt deleted file mode 100644 index c8f3a284bf..0000000000 --- a/ext/standard/tests/strings/nl_langinfo_error1.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Test nl_langinfo() function : error conditions ---SKIPIF-- -<?php -if( substr(PHP_OS, 0, 3) == 'WIN'){ - die('skip Not for Windows'); -} -?> ---FILE-- -<?php - -/* Prototype : string nl_langinfo ( int $item ) - * Description: Query language and locale information - * Source code: ext/standard/string.c -*/ - -echo "*** Testing nl_langinfo() : error conditions ***\n"; - -echo "\n-- Testing nl_langinfo() function with no arguments --\n"; -var_dump( nl_langinfo() ); - -echo "\n-- Testing nl_langinfo() function with more than expected no. of arguments --\n"; -$extra_arg = 10; -var_dump( nl_langinfo(ABDAY_2, $extra_arg) ); - -?> -===DONE=== ---EXPECTF-- -*** Testing nl_langinfo() : error conditions *** - --- Testing nl_langinfo() function with no arguments -- - -Warning: nl_langinfo() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing nl_langinfo() function with more than expected no. of arguments -- - -Warning: nl_langinfo() expects exactly 1 parameter, 2 given in %s on line %d -NULL -===DONE=== diff --git a/ext/standard/tests/strings/nl_langinfo_variation1.phpt b/ext/standard/tests/strings/nl_langinfo_variation1.phpt deleted file mode 100644 index 180991e400..0000000000 --- a/ext/standard/tests/strings/nl_langinfo_variation1.phpt +++ /dev/null @@ -1,104 +0,0 @@ ---TEST-- -Test nl_langinfo() function : unexpected inputs for '$tem' argument ---SKIPIF-- -<?php -if( substr(PHP_OS, 0, 3) == 'WIN'){ - die('skip Not for Windows'); -} -?> ---FILE-- -<?php - -/* Prototype : string nl_langinfo ( int $item ) - * Description: Query language and locale information - * Source code: ext/standard/string.c -*/ - -echo "*** Testing nl_langinfo() : with unexpected inputs for 'item' argument ***\n"; - -$original = setlocale(LC_ALL, 'C'); - -//get an unset variable -$unset_var = 'string_val'; -unset($unset_var); - -//defining a class -class sample { - public function __toString() { - return "sample object"; - } -} - -//getting the resource -$file_handle = fopen(__FILE__, "r"); - -// array with different values for $input -$items = array ( - // integer values -/*1*/ 2147483647, - -2147483648, - -20, - - // array values -/*4*/ array(), - array(0), - array(1, 2), - - // objects -/*7*/ new sample(), - - // resource -/*8*/ $file_handle, - ); - -//defining '$input' argument -$input = "Test string"; - -// loop through with each element of the $items array to test nl_langinfo() function -$count = 1; -foreach($items as $item) { - echo "-- Iteration $count --\n"; - var_dump( nl_langinfo($item) ); - $count ++; -} - -fclose($file_handle); //closing the file handle -setlocale(LC_ALL, $original); - -?> -===DONE=== ---EXPECTF-- -*** Testing nl_langinfo() : with unexpected inputs for 'item' argument *** --- Iteration 1 -- - -Warning: nl_langinfo(): Item '2147483647' is not valid in %s on line %d -bool(false) --- Iteration 2 -- - -Warning: nl_langinfo(): Item '-2147483648' is not valid in %s on line %d -bool(false) --- Iteration 3 -- - -Warning: nl_langinfo(): Item '-20' is not valid in %s on line %d -bool(false) --- Iteration 4 -- - -Warning: nl_langinfo() expects parameter 1 to be int, array given in %s on line %d -NULL --- Iteration 5 -- - -Warning: nl_langinfo() expects parameter 1 to be int, array given in %s on line %d -NULL --- Iteration 6 -- - -Warning: nl_langinfo() expects parameter 1 to be int, array given in %s on line %d -NULL --- Iteration 7 -- - -Warning: nl_langinfo() expects parameter 1 to be int, object given in %s on line %d -NULL --- Iteration 8 -- - -Warning: nl_langinfo() expects parameter 1 to be int, resource given in %s on line %d -NULL -===DONE=== diff --git a/ext/standard/tests/strings/number_format_error.phpt b/ext/standard/tests/strings/number_format_error.phpt deleted file mode 100644 index 933466d12b..0000000000 --- a/ext/standard/tests/strings/number_format_error.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -Test number_format() - wrong params test number_format() ---FILE-- -<?php -/* Prototype : string number_format ( float $number [, int $decimals ] ) - * string number_format ( float $number , int $decimals , string $dec_point , string $thousands_sep ) - * Description: Format a number with grouped thousands - * Source code: ext/standard/string.c - */ - -echo "*** Testing number_format() : error conditions ***\n"; - -echo "\n-- Testing number_format() function with less than expected no. of arguments --\n"; -number_format(); - -echo "\n-- Testing number_format() function with 3 arguments --\n"; -number_format(23,2,true); - -echo "\n-- Testing number_format() function with more than 4 arguments --\n"; -number_format(23,2,true,false,36); - -?> -===DONE=== ---EXPECTF-- -*** Testing number_format() : error conditions *** - --- Testing number_format() function with less than expected no. of arguments -- - -Warning: number_format() expects at least 1 parameter, 0 given in %s on line %d - --- Testing number_format() function with 3 arguments -- - -Warning: Wrong parameter count for number_format() in %s on line %d - --- Testing number_format() function with more than 4 arguments -- - -Warning: number_format() expects at most 4 parameters, 5 given in %s on line %d -===DONE=== diff --git a/ext/standard/tests/strings/ord_error.phpt b/ext/standard/tests/strings/ord_error.phpt deleted file mode 100644 index 455fb38972..0000000000 --- a/ext/standard/tests/strings/ord_error.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Test ord() function : error conditions ---FILE-- -<?php - -/* Prototype : int ord ( string $string ) - * Description: Return ASCII value of character - * Source code: ext/standard/string.c -*/ - -echo "*** Testing ord() : error conditions ***\n"; - -echo "\n-- Testing ord() function with no arguments --\n"; -var_dump( ord() ); - -echo "\n-- Testing ord() function with more than expected no. of arguments --\n"; -$extra_arg = 10; -var_dump( ord(72, $extra_arg) ); - -?> -===DONE=== ---EXPECTF-- -*** Testing ord() : error conditions *** - --- Testing ord() function with no arguments -- - -Warning: ord() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing ord() function with more than expected no. of arguments -- - -Warning: ord() expects exactly 1 parameter, 2 given in %s on line %d -NULL -===DONE=== diff --git a/ext/standard/tests/strings/parse_str_error1.phpt b/ext/standard/tests/strings/parse_str_error1.phpt deleted file mode 100644 index 9683a7d901..0000000000 --- a/ext/standard/tests/strings/parse_str_error1.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Test parse_str() function : non-default arg_separator.input specified ---INI-- -arg_separator.input = "/" ---FILE-- -<?php -/* Prototype : void parse_str ( string $str [, array &$arr ] ) - * Description: Parses the string into variables - * Source code: ext/standard/string.c -*/ - -echo "*** Testing parse_str() : error conditions ***\n"; - -echo "\n-- Testing htmlentities() function with less than expected no. of arguments --\n"; -parse_str(); -echo "\n-- Testing htmlentities() function with more than expected no. of arguments --\n"; -$s1 = "first=val1&second=val2&third=val3"; -parse_str($s1, $res_array, true); - -?> -===DONE=== ---EXPECTF-- -*** Testing parse_str() : error conditions *** - --- Testing htmlentities() function with less than expected no. of arguments -- - -Warning: parse_str() expects at least 1 parameter, 0 given in %s on line %d - --- Testing htmlentities() function with more than expected no. of arguments -- - -Warning: parse_str() expects at most 2 parameters, 3 given in %s on line %d -===DONE=== diff --git a/ext/standard/tests/strings/quoted_printable_decode_error.phpt b/ext/standard/tests/strings/quoted_printable_decode_error.phpt deleted file mode 100644 index 9008f5c861..0000000000 --- a/ext/standard/tests/strings/quoted_printable_decode_error.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -Test quoted_printable_decode() function : error conditions ---FILE-- -<?php -/* Prototype : string quoted_printable_decode ( string $str ) - * Description: Convert a quoted-printable string to an 8 bit string - * Source code: ext/standard/string.c -*/ - -echo "*** Testing quoted_printable_decode() : error conditions ***\n"; - -echo "\n-- Testing quoted_printable_decode() function with no arguments --\n"; -var_dump( quoted_printable_decode() ); - -echo "\n-- Testing quoted_printable_decode() function with more than expected no. of arguments --\n"; -$str = "=FAwow-factor=C1=d0=D5=DD=C5=CE=CE=D9=C5=0A= -=20=D4=cf=D2=C7=CF=D7=D9=C5= -=20= -=D0= -=D2=CF=C5=CB=D4=D9"; -$extra_arg = 10; -var_dump( quoted_printable_decode($str, $extra_arg) ); - -?> -===DONE=== ---EXPECTF-- -*** Testing quoted_printable_decode() : error conditions *** - --- Testing quoted_printable_decode() function with no arguments -- - -Warning: quoted_printable_decode() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing quoted_printable_decode() function with more than expected no. of arguments -- - -Warning: quoted_printable_decode() expects exactly 1 parameter, 2 given in %s on line %d -NULL -===DONE=== diff --git a/ext/standard/tests/strings/quotemeta_error.phpt b/ext/standard/tests/strings/quotemeta_error.phpt deleted file mode 100644 index a4284eca55..0000000000 --- a/ext/standard/tests/strings/quotemeta_error.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Test quotemeta() function : error conditions ---FILE-- -<?php - -/* Prototype : string quotemeta ( string $str ) - * Description: Quote meta characters - * Source code: ext/standard/string.c -*/ - -echo "*** Testing quotemeta() : error conditions ***\n"; - -echo "\n-- Testing quotemeta() function with no arguments --\n"; -var_dump( quotemeta()); - -echo "\n-- Testing quotemeta() function with more than expected no. of arguments --\n"; -$extra_arg = 10; -var_dump(quotemeta("How are you ?", $extra_arg)); - -?> -===DONE=== ---EXPECTF-- -*** Testing quotemeta() : error conditions *** - --- Testing quotemeta() function with no arguments -- - -Warning: quotemeta() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing quotemeta() function with more than expected no. of arguments -- - -Warning: quotemeta() expects exactly 1 parameter, 2 given in %s on line %d -NULL -===DONE=== diff --git a/ext/standard/tests/strings/sha1_error.phpt b/ext/standard/tests/strings/sha1_error.phpt deleted file mode 100644 index 193c64e941..0000000000 --- a/ext/standard/tests/strings/sha1_error.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -Test sha1() function : error conditions ---FILE-- -<?php - - -/* Prototype: string sha1 ( string $str [, bool $raw_output ] ) - * Description: Calculate the sha1 hash of a string - */ - -echo "*** Testing sha1() : error conditions ***\n"; - -echo "\n-- Testing sha1() function with no arguments --\n"; -var_dump( sha1() ); - -echo "\n-- Testing sha1() function with more than expected no. of arguments --\n"; -$extra_arg = 10; -var_dump( sha1("Hello World", true, $extra_arg) ); - - -?> -===DONE=== ---EXPECTF-- -*** Testing sha1() : error conditions *** - --- Testing sha1() function with no arguments -- - -Warning: sha1() expects at least 1 parameter, 0 given in %s on line %d -NULL - --- Testing sha1() function with more than expected no. of arguments -- - -Warning: sha1() expects at most 2 parameters, 3 given in %s on line %d -NULL -===DONE=== diff --git a/ext/standard/tests/strings/similar_text_error.phpt b/ext/standard/tests/strings/similar_text_error.phpt deleted file mode 100644 index a5e9501337..0000000000 --- a/ext/standard/tests/strings/similar_text_error.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -similar_text(), error tests for missing parameters ---CREDITS-- -Mats Lindh <mats at lindh.no> -#Testfest php.no ---FILE-- -<?php -/* Prototype : proto int similar_text(string str1, string str2 [, float percent]) -* Description: Calculates the similarity between two strings -* Source code: ext/standard/string.c -*/ - -$extra_arg = 10; -echo "\n-- Testing similar_text() function with more than expected no. of arguments --\n"; -similar_text("abc", "def", $percent, $extra_arg); - -echo "\n-- Testing similar_text() function with less than expected no. of arguments --\n"; -similar_text("abc"); -?> -===DONE=== ---EXPECTF-- --- Testing similar_text() function with more than expected no. of arguments -- - -Warning: similar_text() expects at most 3 parameters, 4 given in %s on line %d - --- Testing similar_text() function with less than expected no. of arguments -- - -Warning: similar_text() expects at least 2 parameters, 1 given in %s on line %d -===DONE=== diff --git a/ext/standard/tests/strings/soundex_error.phpt b/ext/standard/tests/strings/soundex_error.phpt deleted file mode 100644 index 8ff93b6d70..0000000000 --- a/ext/standard/tests/strings/soundex_error.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Test soundex() function : error conditions ---FILE-- -<?php -/* Prototype : string soundex ( string $str ) - * Description: Calculate the soundex key of a string - * Source code: ext/standard/string.c -*/ - -echo "\n*** Testing soundex error conditions ***"; - -echo "-- Testing soundex() function with Zero arguments --\n"; -var_dump( soundex() ); - -echo "\n\n-- Testing soundex() function with more than expected no. of arguments --\n"; -$str = "Euler"; -$extra_arg = 10; -var_dump( soundex( $str, $extra_arg) ); - -?> -===DONE=== ---EXPECTF-- -*** Testing soundex error conditions ***-- Testing soundex() function with Zero arguments -- - -Warning: soundex() expects exactly 1 parameter, 0 given in %s on line %d -NULL - - --- Testing soundex() function with more than expected no. of arguments -- - -Warning: soundex() expects exactly 1 parameter, 2 given in %s on line %d -NULL -===DONE=== diff --git a/ext/standard/tests/strings/sscanf_variation1.phpt b/ext/standard/tests/strings/sscanf_variation1.phpt deleted file mode 100644 index cb5cdc754a..0000000000 --- a/ext/standard/tests/strings/sscanf_variation1.phpt +++ /dev/null @@ -1,169 +0,0 @@ ---TEST-- -Test sscanf() function : usage variations - unexpected inputs for '$str' argument ---FILE-- -<?php -/* Prototype : mixed sscanf ( string $str , string $format [, mixed &$... ] ) - * Description: Parses input from a string according to a format - * Source code: ext/standard/string.c -*/ - -echo "*** Testing sscanf() function: with unexpected inputs for 'str' argument ***\n"; - -//get an unset variable -$unset_var = 'string_val'; -unset($unset_var); - -//defining a class -class sample { - public function __toString() { - return "sample object"; - } -} - -//getting the resource -$file_handle = fopen(__FILE__, "r"); - -// array with different values for $input -$inputs = array ( - - // integer values -/*1*/ 0, - 1, - -2, - 2147483647, - -2147483648, - - // float values -/*6*/ 10.5, - -20.5, - 10.1234567e10, - - // array values -/*9*/ array(), - array(0), - array(1, 2), - - // boolean values -/*12*/ true, - false, - TRUE, - FALSE, - - // null values -/*16*/ NULL, - null, - - // objects -/*18*/ new sample(), - - // resource -/*19*/ $file_handle, - - // undefined variable -/*20*/ @$undefined_var, - - // unset variable -/*21*/ @$unset_var -); - -//defining '$pad_length' argument -$format = "%s"; - -// loop through with each element of the $inputs array to test sscanf() function -$count = 1; -foreach($inputs as $input) { - echo "-- Iteration $count --\n"; - var_dump( sscanf($input, $format) ); - $count ++; -} - -fclose($file_handle); //closing the file handle - -?> -===DONE=== ---EXPECTF-- -*** Testing sscanf() function: with unexpected inputs for 'str' argument *** --- Iteration 1 -- -array(1) { - [0]=> - string(1) "0" -} --- Iteration 2 -- -array(1) { - [0]=> - string(1) "1" -} --- Iteration 3 -- -array(1) { - [0]=> - string(2) "-2" -} --- Iteration 4 -- -array(1) { - [0]=> - string(10) "2147483647" -} --- Iteration 5 -- -array(1) { - [0]=> - string(11) "-2147483648" -} --- Iteration 6 -- -array(1) { - [0]=> - string(4) "10.5" -} --- Iteration 7 -- -array(1) { - [0]=> - string(5) "-20.5" -} --- Iteration 8 -- -array(1) { - [0]=> - string(12) "101234567000" -} --- Iteration 9 -- - -Warning: sscanf() expects parameter 1 to be string, array given in %s on line %d -NULL --- Iteration 10 -- - -Warning: sscanf() expects parameter 1 to be string, array given in %s on line %d -NULL --- Iteration 11 -- - -Warning: sscanf() expects parameter 1 to be string, array given in %s on line %d -NULL --- Iteration 12 -- -array(1) { - [0]=> - string(1) "1" -} --- Iteration 13 -- -NULL --- Iteration 14 -- -array(1) { - [0]=> - string(1) "1" -} --- Iteration 15 -- -NULL --- Iteration 16 -- -NULL --- Iteration 17 -- -NULL --- Iteration 18 -- -array(1) { - [0]=> - string(6) "sample" -} --- Iteration 19 -- - -Warning: sscanf() expects parameter 1 to be string, resource given in %s on line %d -NULL --- Iteration 20 -- -NULL --- Iteration 21 -- -NULL -===DONE=== diff --git a/ext/standard/tests/strings/sscanf_variation2.phpt b/ext/standard/tests/strings/sscanf_variation2.phpt deleted file mode 100644 index dede6e8d98..0000000000 --- a/ext/standard/tests/strings/sscanf_variation2.phpt +++ /dev/null @@ -1,153 +0,0 @@ ---TEST-- -Test sscanf() function : usage variations - unexpected inputs for '$format' argument ---FILE-- -<?php -/* Prototype : mixed sscanf ( string $str , string $format [, mixed &$... ] ) - * Description: Parses input from a string according to a format - * Source code: ext/standard/string.c -*/ - -echo "*** Testing sscanf() function: with unexpected inputs for 'format' argument ***\n"; - -//get an unset variable -$unset_var = 'string_val'; -unset($unset_var); - -//defining a class -class sample { - public function __toString() { - return "sample object"; - } -} - -//getting the resource -$file_handle = fopen(__FILE__, "r"); - -// array with different values for $input -$inputs = array ( - - // integer values -/*1*/ 0, - 1, - -2, - 2147483647, - -2147483648, - - // float values -/*6*/ 10.5, - -20.5, - 10.1234567e10, - - // array values -/*9*/ array(), - array(0), - array(1, 2), - - // boolean values -/*12*/ true, - false, - TRUE, - FALSE, - - // null values -/*16*/ NULL, - null, - - // objects -/*18*/ new sample(), - - // resource -/*19*/ $file_handle, - - // undefined variable -/*20*/ @$undefined_var, - - // unset variable -/*21*/ @$unset_var -); - -//defining '$pad_length' argument -$str = "Hello World"; - -// loop through with each element of the $inputs array to test sscanf() function -$count = 1; -foreach($inputs as $input) { - echo "-- Iteration $count --\n"; - var_dump( sscanf($str, $input) ); - $count ++; -} - -fclose($file_handle); //closing the file handle - -?> -===DONE=== ---EXPECTF-- -*** Testing sscanf() function: with unexpected inputs for 'format' argument *** --- Iteration 1 -- -array(0) { -} --- Iteration 2 -- -array(0) { -} --- Iteration 3 -- -array(0) { -} --- Iteration 4 -- -array(0) { -} --- Iteration 5 -- -array(0) { -} --- Iteration 6 -- -array(0) { -} --- Iteration 7 -- -array(0) { -} --- Iteration 8 -- -array(0) { -} --- Iteration 9 -- - -Warning: sscanf() expects parameter 2 to be string, array given in %s on line %d -NULL --- Iteration 10 -- - -Warning: sscanf() expects parameter 2 to be string, array given in %s on line %d -NULL --- Iteration 11 -- - -Warning: sscanf() expects parameter 2 to be string, array given in %s on line %d -NULL --- Iteration 12 -- -array(0) { -} --- Iteration 13 -- -array(0) { -} --- Iteration 14 -- -array(0) { -} --- Iteration 15 -- -array(0) { -} --- Iteration 16 -- -array(0) { -} --- Iteration 17 -- -array(0) { -} --- Iteration 18 -- -array(0) { -} --- Iteration 19 -- - -Warning: sscanf() expects parameter 2 to be string, resource given in %s on line %d -NULL --- Iteration 20 -- -array(0) { -} --- Iteration 21 -- -array(0) { -} -===DONE=== diff --git a/ext/standard/tests/strings/str_replace_error.phpt b/ext/standard/tests/strings/str_replace_error.phpt deleted file mode 100644 index c2d1d4fe2b..0000000000 --- a/ext/standard/tests/strings/str_replace_error.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Test str_replace() function error conditions ---INI-- -precision=14 ---FILE-- -<?php -/* - Prototype: mixed str_replace(mixed $search, mixed $replace, - mixed $subject [, int &$count]); - Description: Replace all occurrences of the search string with - the replacement string -*/ - - -echo "\n*** Testing str_replace error conditions ***"; -/* Invalid arguments */ -var_dump( str_replace() ); -var_dump( str_replace("") ); -var_dump( str_replace(NULL) ); -var_dump( str_replace(1, 2) ); -var_dump( str_replace(1,2,3,$var,5) ); - -?> -===DONE=== ---EXPECTF-- -*** Testing str_replace error conditions *** -Warning: str_replace() expects at least 3 parameters, 0 given in %sstr_replace_error.php on line 12 -NULL - -Warning: str_replace() expects at least 3 parameters, 1 given in %sstr_replace_error.php on line 13 -NULL - -Warning: str_replace() expects at least 3 parameters, 1 given in %sstr_replace_error.php on line 14 -NULL - -Warning: str_replace() expects at least 3 parameters, 2 given in %sstr_replace_error.php on line 15 -NULL - -Warning: str_replace() expects at most 4 parameters, 5 given in %sstr_replace_error.php on line 16 -NULL -===DONE=== diff --git a/ext/standard/tests/strings/str_rot13_error.phpt b/ext/standard/tests/strings/str_rot13_error.phpt deleted file mode 100644 index ee0ea4165e..0000000000 --- a/ext/standard/tests/strings/str_rot13_error.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Test str_rot13() function : error conditions ---FILE-- -<?php -/* Prototype : string str_rot13 ( string $str ) - * Description: Perform the rot13 transform on a string - * Source code: ext/standard/string.c -*/ -echo "*** Testing str_rot13() : error conditions ***\n"; - -echo "-- Testing str_rot13() function with Zero arguments --\n"; -var_dump( str_rot13() ); - -echo "\n\n-- Testing str_rot13() function with more than expected no. of arguments --\n"; -$str = "str_rot13() tests starting"; -$extra_arg = 10; -var_dump( str_rot13( $str, $extra_arg) ); -?> -===DONE=== ---EXPECTF-- -*** Testing str_rot13() : error conditions *** --- Testing str_rot13() function with Zero arguments -- - -Warning: str_rot13() expects exactly 1 parameter, 0 given in %s on line %d -NULL - - --- Testing str_rot13() function with more than expected no. of arguments -- - -Warning: str_rot13() expects exactly 1 parameter, 2 given in %s on line %d -NULL -===DONE=== diff --git a/ext/standard/tests/strings/str_shuffle_error.phpt b/ext/standard/tests/strings/str_shuffle_error.phpt deleted file mode 100644 index 46911407f0..0000000000 --- a/ext/standard/tests/strings/str_shuffle_error.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Test str_shuffle() function : error conditions ---FILE-- -<?php - -/* Prototype : string str_shuffle ( string $str ) - * Description: Randomly shuffles a string - * Source code: ext/standard/string.c -*/ -echo "*** Testing str_shuffle() : error conditions ***\n"; - -echo "\n-- Testing str_shuffle() function with no arguments --\n"; -var_dump( str_shuffle() ); - -echo "\n-- Testing str_shuffle() function with more than expected no. of arguments --\n"; -$extra_arg = 10; -var_dump( str_shuffle("Hello World", $extra_arg) ); - -?> -===DONE=== ---EXPECTF-- -*** Testing str_shuffle() : error conditions *** - --- Testing str_shuffle() function with no arguments -- - -Warning: str_shuffle() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing str_shuffle() function with more than expected no. of arguments -- - -Warning: str_shuffle() expects exactly 1 parameter, 2 given in %s on line %d -NULL -===DONE=== diff --git a/ext/standard/tests/strings/str_split_error.phpt b/ext/standard/tests/strings/str_split_error.phpt deleted file mode 100644 index 1a4558e680..0000000000 --- a/ext/standard/tests/strings/str_split_error.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -Test str_split() function : error conditions ---FILE-- -<?php -/* Prototype : array str_split(string $str [, int $split_length]) - * Description: Convert a string to an array. If split_length is - specified, break the string down into chunks each - split_length characters long. - * Source code: ext/standard/string.c - * Alias to functions: none -*/ - -echo "*** Testing str_split() : error conditions ***\n"; - -// Zero arguments -echo "-- Testing str_split() function with Zero arguments --\n"; -var_dump( str_split() ); - -//Test str_split with one more than the expected number of arguments -echo "-- Testing str_split() function with more than expected no. of arguments --\n"; -$str = 'This is error testcase'; -$split_length = 4; -$extra_arg = 10; -var_dump( str_split( $str, $split_length, $extra_arg) ); - -echo "Done" -?> ---EXPECTF-- -*** Testing str_split() : error conditions *** --- Testing str_split() function with Zero arguments -- - -Warning: str_split() expects at least 1 parameter, 0 given in %s on line %d -NULL --- Testing str_split() function with more than expected no. of arguments -- - -Warning: str_split() expects at most 2 parameters, 3 given in %s on line %d -NULL -Done diff --git a/ext/standard/tests/strings/strcoll_error.phpt b/ext/standard/tests/strings/strcoll_error.phpt deleted file mode 100644 index 56466bb63e..0000000000 --- a/ext/standard/tests/strings/strcoll_error.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Test strcoll() function : error conditions ---SKIPIF-- -<?php if (!function_exists('strcoll')) die('skip strcoll function not available') ?> ---FILE-- -<?php -/* Prototype: int strcoll ( string $str1 , string $str2 ) - Description: Locale based string comparison -*/ - -echo "*** Testing strcoll() : error conditions ***\n"; - -echo "\n-- Testing strcoll() function with no arguments --\n"; -var_dump( strcoll() ); -var_dump( strcoll("") ); - -echo "\n-- Testing strcoll() function with one argument --\n"; -var_dump( strcoll("Hello World") ); - -echo "\n-- Testing strcoll() function with more than expected no. of arguments --\n"; -$extra_arg = 10; -var_dump( strcoll("Hello World", "World", $extra_arg) ); - -?> -===Done=== ---EXPECTF-- -*** Testing strcoll() : error conditions *** - --- Testing strcoll() function with no arguments -- - -Warning: strcoll() expects exactly 2 parameters, 0 given in %s on line %d -NULL - -Warning: strcoll() expects exactly 2 parameters, 1 given in %s on line %d -NULL - --- Testing strcoll() function with one argument -- - -Warning: strcoll() expects exactly 2 parameters, 1 given in %s on line %d -NULL - --- Testing strcoll() function with more than expected no. of arguments -- - -Warning: strcoll() expects exactly 2 parameters, 3 given in %s on line %d -NULL -===Done=== diff --git a/ext/standard/tests/strings/strcspn_error.phpt b/ext/standard/tests/strings/strcspn_error.phpt deleted file mode 100644 index ebb7f9f0d0..0000000000 --- a/ext/standard/tests/strings/strcspn_error.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -Test strcspn() function : error conditions ---FILE-- -<?php -/* Prototype : proto int strcspn(string str, string mask [, int start [, int len]]) - * Description: Finds length of initial segment consisting entirely of characters not found in mask. - If start or/and length is provided works like strcspn(substr($s,$start,$len),$bad_chars) - * Source code: ext/standard/string.c - * Alias to functions: none -*/ - -/* -* Test strcspn() : for error conditons -*/ - -echo "*** Testing strcspn() : error conditions ***\n"; - -// Zero arguments -echo "\n-- Testing strcspn() function with Zero arguments --\n"; -var_dump( strcspn() ); - -//Test strcspn with one more than the expected number of arguments -echo "\n-- Testing strcspn() function with more than expected no. of arguments --\n"; -$str = 'string_val'; -$mask = 'string_val'; -$start = 2; -$len = 20; - - -$extra_arg = 10; -var_dump( strcspn($str,$mask,$start,$len, $extra_arg) ); - -// Testing strcspn withone less than the expected number of arguments -echo "\n-- Testing strcspn() function with less than expected no. of arguments --\n"; -$str = 'string_val'; -var_dump( strcspn($str) ); - -echo "Done" -?> ---EXPECTF-- -*** Testing strcspn() : error conditions *** - --- Testing strcspn() function with Zero arguments -- - -Warning: strcspn() expects at least 2 parameters, 0 given in %s on line %d -NULL - --- Testing strcspn() function with more than expected no. of arguments -- - -Warning: strcspn() expects at most 4 parameters, 5 given in %s on line %d -NULL - --- Testing strcspn() function with less than expected no. of arguments -- - -Warning: strcspn() expects at least 2 parameters, 1 given in %s on line %d -NULL -Done diff --git a/ext/standard/tests/strings/strip_tags_error.phpt b/ext/standard/tests/strings/strip_tags_error.phpt deleted file mode 100644 index 25f703c3c0..0000000000 --- a/ext/standard/tests/strings/strip_tags_error.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Test strip_tags() function : error conditions ---INI-- -short_open_tag = on ---FILE-- -<?php -/* Prototype : string strip_tags(string $str [, string $allowable_tags]) - * Description: Strips HTML and PHP tags from a string - * Source code: ext/standard/string.c -*/ - - -echo "*** Testing strip_tags() : error conditions ***\n"; - -// Zero arguments -echo "\n-- Testing strip_tags() function with Zero arguments --\n"; -var_dump( strip_tags() ); - -//Test strip_tags with one more than the expected number of arguments -echo "\n-- Testing strip_tags() function with more than expected no. of arguments --\n"; -$str = "<html>hello</html>"; -$allowable_tags = "<html>"; -$extra_arg = 10; -var_dump( strip_tags($str, $allowable_tags, $extra_arg) ); - -echo "Done"; -?> ---EXPECTF-- -*** Testing strip_tags() : error conditions *** - --- Testing strip_tags() function with Zero arguments -- - -Warning: strip_tags() expects at least 1 parameter, 0 given in %s on line %d -NULL - --- Testing strip_tags() function with more than expected no. of arguments -- - -Warning: strip_tags() expects at most 2 parameters, 3 given in %s on line %d -NULL -Done diff --git a/ext/standard/tests/strings/stripcslashes_error.phpt b/ext/standard/tests/strings/stripcslashes_error.phpt deleted file mode 100644 index 174da56443..0000000000 --- a/ext/standard/tests/strings/stripcslashes_error.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Test stripcslashes() function : error conditions ---FILE-- -<?php - -/* Prototype : string stripcslashes ( string $str ) - * Description: Returns a string with backslashes stripped off. Recognizes C-like \n, \r ..., - * octal and hexadecimal representation. - * Source code: ext/standard/string.c -*/ - -echo "*** Testing stripcslashes() : unexpected number of arguments ***"; - - -echo "\n-- Testing stripcslashes() function with no arguments --\n"; -var_dump( stripcslashes() ); - -echo "\n-- Testing stripcslashes() function with more than expected no. of arguments --\n"; -$extra_arg = 10; -var_dump( stripcslashes("abc def", $extra_arg) ); -?> -===DONE=== ---EXPECTF-- -*** Testing stripcslashes() : unexpected number of arguments *** --- Testing stripcslashes() function with no arguments -- - -Warning: stripcslashes() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing stripcslashes() function with more than expected no. of arguments -- - -Warning: stripcslashes() expects exactly 1 parameter, 2 given in %s on line %d -NULL -===DONE=== diff --git a/ext/standard/tests/strings/stripos_variation15.phpt b/ext/standard/tests/strings/stripos_variation15.phpt deleted file mode 100644 index f8d4f029fe..0000000000 --- a/ext/standard/tests/strings/stripos_variation15.phpt +++ /dev/null @@ -1,185 +0,0 @@ ---TEST-- -Test stripos() function : usage variations - unexpected inputs for 'haystack', 'needle' & 'offset' arguments ---SKIPIF-- -<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only"); ---FILE-- -<?php -/* Prototype : int stripos ( string $haystack, string $needle [, int $offset] ); - * Description: Find position of first occurrence of a case-insensitive string - * Source code: ext/standard/string.c -*/ - -/* Test stripos() function with unexpected inputs for 'haystack', 'needle' & 'offset' arguments */ - -echo "*** Testing stripos() function with unexpected values for haystack, needle & offset ***\n"; - -// get an unset variable -$unset_var = 'string_val'; -unset($unset_var); - -// defining a class -class sample { - public function __toString() { - return "object"; - } -} - -//getting the resource -$file_handle = fopen(__FILE__, "r"); - -// array with different values -$values = array ( - - // integer values - 0, - 1, - 12345, - -2345, - - // float values - 10.5, - -10.5, - 10.5e10, - 10.6E-10, - .5, - - // array values - array(), - array(0), - array(1), - array(1, 2), - array('color' => 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // objects - new sample(), - - // empty string - "", - '', - - // null values - NULL, - null, - - //resource - $file_handle, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var -); - - -// loop through each element of the array and check the working of stripos() -$counter = 1; -for($index = 0; $index < count($values); $index ++) { - echo "-- Iteration $counter --\n"; - var_dump( stripos($values[$index], $values[$index], $values[$index]) ); - $counter ++; -} - -echo "*** Done ***"; -?> ---EXPECTF-- -*** Testing stripos() function with unexpected values for haystack, needle & offset *** --- Iteration 1 -- - -Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d -bool(false) --- Iteration 2 -- - -Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d -bool(false) --- Iteration 3 -- - -Warning: stripos(): Offset not contained in string in %s on line %d -bool(false) --- Iteration 4 -- - -Warning: stripos(): Offset not contained in string in %s on line %d -bool(false) --- Iteration 5 -- - -Warning: stripos(): Offset not contained in string in %s on line %d -bool(false) --- Iteration 6 -- - -Warning: stripos(): Offset not contained in string in %s on line %d -bool(false) --- Iteration 7 -- - -Warning: stripos(): Offset not contained in string in %s on line %d -bool(false) --- Iteration 8 -- - -Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d -bool(false) --- Iteration 9 -- - -Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d -bool(false) --- Iteration 10 -- - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL --- Iteration 11 -- - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL --- Iteration 12 -- - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL --- Iteration 13 -- - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL --- Iteration 14 -- - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL --- Iteration 15 -- - -Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d -bool(false) --- Iteration 16 -- -bool(false) --- Iteration 17 -- - -Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d -bool(false) --- Iteration 18 -- -bool(false) --- Iteration 19 -- - -Warning: stripos() expects parameter 3 to be int, object given in %s on line %d -NULL --- Iteration 20 -- - -Warning: stripos() expects parameter 3 to be int, string given in %s on line %d -NULL --- Iteration 21 -- - -Warning: stripos() expects parameter 3 to be int, string given in %s on line %d -NULL --- Iteration 22 -- -bool(false) --- Iteration 23 -- -bool(false) --- Iteration 24 -- - -Warning: stripos() expects parameter 1 to be string, resource given in %s on line %d -NULL --- Iteration 25 -- -bool(false) --- Iteration 26 -- -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/stripslashes_error.phpt b/ext/standard/tests/strings/stripslashes_error.phpt deleted file mode 100644 index 81b9889fc4..0000000000 --- a/ext/standard/tests/strings/stripslashes_error.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Test stripslashes() function : error conditions ---FILE-- -<?php -/* Prototype : string stripslashes ( string $str ) - * Description: Returns an un-quoted string - * Source code: ext/standard/string.c -*/ - -/* - * Testing stripslashes() for error conditions -*/ - -echo "*** Testing stripslashes() : error conditions ***\n"; - -// Zero argument -echo "\n-- Testing stripslashes() function with Zero arguments --\n"; -var_dump( stripslashes() ); - -// More than expected number of arguments -echo "\n-- Testing stripslashes() function with more than expected no. of arguments --\n"; -$str = '\"hello\"\"world\"'; -$extra_arg = 10; - -var_dump( stripslashes($str, $extra_arg) ); -var_dump( $str ); - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing stripslashes() : error conditions *** - --- Testing stripslashes() function with Zero arguments -- - -Warning: stripslashes() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing stripslashes() function with more than expected no. of arguments -- - -Warning: stripslashes() expects exactly 1 parameter, 2 given in %s on line %d -NULL -string(18) "\"hello\"\"world\"" -Done diff --git a/ext/standard/tests/strings/strlen_variation1.phpt b/ext/standard/tests/strings/strlen_variation1.phpt deleted file mode 100644 index f1d6b6b978..0000000000 --- a/ext/standard/tests/strings/strlen_variation1.phpt +++ /dev/null @@ -1,137 +0,0 @@ ---TEST-- -Test strlen() function : usage variations - unexpected input for '$string' argument ---FILE-- -<?php - -/* Prototype : int strlen ( string $string ) - * Description: Get string length - * Source code: ext/standard/string.c -*/ - -echo "*** Testing strlen() : with unexpected input for 'string' argument ***\n"; - -//get an unset variable -$unset_var = 'string_val'; -unset($unset_var); - -//defining a class -class sample { - public function __toString() { - return "sample object"; - } -} - -//getting the resource -$file_handle = fopen(__FILE__, "r"); - -// array with different values for $input -$inputs = array ( - - // integer values -/*1*/ 0, - 1, - -2, - 2147483647, - -2147483648, - - // float values -/*6*/ 10.5, - -20.5, - 10.1234567e10, - - // array values -/*9*/ array(), - array(0), - array(1, 2), - - // boolean values -/*12*/ true, - false, - TRUE, - FALSE, - - // null values -/*16*/ NULL, - null, - - // objects -/*18*/ new sample(), - - // resource -/*19*/ $file_handle, - - // undefined variable -/*20*/ @$undefined_var, - - // unset variable -/*21*/ @$unset_var -); - -//defining '$pad_length' argument -$pad_length = "20"; - -// loop through with each element of the $inputs array to test strlen() function -$count = 1; -foreach($inputs as $input) { - echo "-- Iteration $count --\n"; - var_dump( strlen($input) ); - $count ++; -} - -fclose($file_handle); //closing the file handle - -?> -===DONE=== ---EXPECTF-- -*** Testing strlen() : with unexpected input for 'string' argument *** --- Iteration 1 -- -int(1) --- Iteration 2 -- -int(1) --- Iteration 3 -- -int(2) --- Iteration 4 -- -int(10) --- Iteration 5 -- -int(11) --- Iteration 6 -- -int(4) --- Iteration 7 -- -int(5) --- Iteration 8 -- -int(12) --- Iteration 9 -- - -Warning: strlen() expects parameter 1 to be string, array given in %s on line %d -NULL --- Iteration 10 -- - -Warning: strlen() expects parameter 1 to be string, array given in %s on line %d -NULL --- Iteration 11 -- - -Warning: strlen() expects parameter 1 to be string, array given in %s on line %d -NULL --- Iteration 12 -- -int(1) --- Iteration 13 -- -int(0) --- Iteration 14 -- -int(1) --- Iteration 15 -- -int(0) --- Iteration 16 -- -int(0) --- Iteration 17 -- -int(0) --- Iteration 18 -- -int(13) --- Iteration 19 -- - -Warning: strlen() expects parameter 1 to be string, resource given in %s on line %d -NULL --- Iteration 20 -- -int(0) --- Iteration 21 -- -int(0) -===DONE=== diff --git a/ext/standard/tests/strings/strnatcasecmp_error.phpt b/ext/standard/tests/strings/strnatcasecmp_error.phpt deleted file mode 100644 index 6a0fca76e9..0000000000 --- a/ext/standard/tests/strings/strnatcasecmp_error.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Test strnatcasecmp() function : error conditions ---FILE-- -<?php -/* Prototype : int strnatcasecmp ( string $str1 , string $str2 ) - * Description: Case insensitive string comparisons using a "natural order" algorithm - * Source code: ext/standard/string.c -*/ -echo "*** Testing strnatcasecmp() : error conditions ***\n"; - -echo "-- Testing strnatcmp() function with Zero arguments --\n"; -var_dump( strnatcasecmp() ); - -echo "\n\n-- Testing strnatcasecmp() function with more than expected no. of arguments --\n"; -$str1 = "abc1"; -$str2 = "ABC1"; -$extra_arg = 10; -var_dump( strnatcasecmp( $str1, $str2, $extra_arg) ); -?> -===DONE=== ---EXPECTF-- -*** Testing strnatcasecmp() : error conditions *** --- Testing strnatcmp() function with Zero arguments -- - -Warning: strnatcasecmp() expects exactly 2 parameters, 0 given in %s on line %d -NULL - - --- Testing strnatcasecmp() function with more than expected no. of arguments -- - -Warning: strnatcasecmp() expects exactly 2 parameters, 3 given in %s on line %d -NULL -===DONE=== diff --git a/ext/standard/tests/strings/strnatcmp_error.phpt b/ext/standard/tests/strings/strnatcmp_error.phpt deleted file mode 100644 index 2b6d93afee..0000000000 --- a/ext/standard/tests/strings/strnatcmp_error.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Test strnatcmp() function : error conditions ---FILE-- -<?php -/* Prototype : int strnatcmp ( string $str1 , string $str2 ) - * Description: String comparisons using a "natural order" algorithm - * Source code: ext/standard/string.c -*/ -echo "*** Testing strnatcmp() : error conditions ***\n"; - -echo "-- Testing strnatcmp() function with Zero arguments --\n"; -var_dump( strnatcmp() ); - -echo "\n\n-- Testing strnatcmp() function with more than expected no. of arguments --\n"; -$str1 = "abc1"; -$str2 = "ABC1"; -$extra_arg = 10; -var_dump( strnatcmp( $str1, $str2, $extra_arg) ); - -?> -===DONE=== ---EXPECTF-- -*** Testing strnatcmp() : error conditions *** --- Testing strnatcmp() function with Zero arguments -- - -Warning: strnatcmp() expects exactly 2 parameters, 0 given in %s on line %d -NULL - - --- Testing strnatcmp() function with more than expected no. of arguments -- - -Warning: strnatcmp() expects exactly 2 parameters, 3 given in %s on line %d -NULL -===DONE=== diff --git a/ext/standard/tests/strings/strrchr_error.phpt b/ext/standard/tests/strings/strrchr_error.phpt deleted file mode 100644 index de5a9d34de..0000000000 --- a/ext/standard/tests/strings/strrchr_error.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Test strrchr() function : error conditions ---FILE-- -<?php -/* Prototype : string strrchr(string $haystack, string $needle); - * Description: Finds the last occurrence of a character in a string. - * Source code: ext/standard/string.c -*/ - -echo "*** Testing strrchr() function: error conditions ***\n"; -$haystack = "Hello"; -$needle = "Hello"; -$extra_arg = "Hello"; - -echo "\n-- Testing strrchr() function with Zero arguments --"; -var_dump( strrchr() ); - -echo "\n-- Testing strrchr() function with less than expected no. of arguments --"; -var_dump( strrchr($haystack) ); - -echo "\n-- Testing strrchr() function with more than expected no. of arguments --"; -var_dump( strrchr($haystack, $needle, $extra_arg) ); - -echo "*** Done ***"; -?> ---EXPECTF-- -*** Testing strrchr() function: error conditions *** - --- Testing strrchr() function with Zero arguments -- -Warning: strrchr() expects exactly 2 parameters, 0 given in %s on line %d -NULL - --- Testing strrchr() function with less than expected no. of arguments -- -Warning: strrchr() expects exactly 2 parameters, 1 given in %s on line %d -NULL - --- Testing strrchr() function with more than expected no. of arguments -- -Warning: strrchr() expects exactly 2 parameters, 3 given in %s on line %d -NULL -*** Done *** diff --git a/ext/standard/tests/strings/strrev_error.phpt b/ext/standard/tests/strings/strrev_error.phpt deleted file mode 100644 index 2bc8a228ef..0000000000 --- a/ext/standard/tests/strings/strrev_error.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Test strrev() function : error conditions ---FILE-- -<?php -/* Prototype : string strrev(string $str); - * Description: Reverse a string - * Source code: ext/standard/string.c -*/ - -echo "*** Testing strrev() : error conditions ***\n"; -echo "-- Testing strrev() function with Zero arguments --"; -var_dump( strrev() ); - -echo "\n-- Testing strrev() function with more than expected no. of arguments --"; -var_dump( strrev("string", 'extra_arg') ); -echo "*** Done ***"; -?> ---EXPECTF-- -*** Testing strrev() : error conditions *** --- Testing strrev() function with Zero arguments -- -Warning: strrev() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing strrev() function with more than expected no. of arguments -- -Warning: strrev() expects exactly 1 parameter, 2 given in %s on line %d -NULL -*** Done *** diff --git a/ext/standard/tests/strings/strrpos_error.phpt b/ext/standard/tests/strings/strrpos_error.phpt deleted file mode 100644 index d97af99920..0000000000 --- a/ext/standard/tests/strings/strrpos_error.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Test strrpos() function : error conditions ---FILE-- -<?php -/* Prototype : int strrpos ( string $haystack, string $needle [, int $offset] ); - * Description: Find position of last occurrence of 'needle' in 'haystack'. - * Source code: ext/standard/string.c -*/ - -echo "*** Testing strrpos() function: error conditions ***"; -echo "\n-- With Zero arguments --"; -var_dump( strrpos() ); - -echo "\n-- With less than expected number of arguments --"; -var_dump( strrpos("String") ); - -echo "\n-- With more than expected number of arguments --"; -var_dump( strrpos("string", "String", 1, 'extra_arg') ); -echo "*** Done ***"; -?> ---EXPECTF-- -*** Testing strrpos() function: error conditions *** --- With Zero arguments -- -Warning: strrpos() expects at least 2 parameters, 0 given in %s on line %d -bool(false) - --- With less than expected number of arguments -- -Warning: strrpos() expects at least 2 parameters, 1 given in %s on line %d -bool(false) - --- With more than expected number of arguments -- -Warning: strrpos() expects at most 3 parameters, 4 given in %s on line %d -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/strspn_error.phpt b/ext/standard/tests/strings/strspn_error.phpt deleted file mode 100644 index 0cf88c25d2..0000000000 --- a/ext/standard/tests/strings/strspn_error.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -Test strspn() function : error conditions ---FILE-- -<?php -/* Prototype : proto int strspn(string str, string mask [, int start [, int len]]) - * Description: Finds length of initial segment consisting entirely of characters found in mask. - If start or/and length is provided works like strspn(substr($s,$start,$len),$good_chars) - * Source code: ext/standard/string.c - * Alias to functions: none -*/ - -/* -* Test strspn() : for error conditons -*/ - -echo "*** Testing strspn() : error conditions ***\n"; - -// Zero arguments -echo "\n-- Testing strspn() function with Zero arguments --\n"; -var_dump( strspn() ); - -//Test strspn with one more than the expected number of arguments -echo "\n-- Testing strspn() function with more than expected no. of arguments --\n"; -$str = 'string_val'; -$mask = 'string_val'; -$start = 2; -$len = 20; - - -$extra_arg = 10; -var_dump( strspn($str,$mask,$start,$len, $extra_arg) ); - -// Testing strspn withone less than the expected number of arguments -echo "\n-- Testing strspn() function with less than expected no. of arguments --\n"; -$str = 'string_val'; -var_dump( strspn($str) ); - -echo "Done" -?> ---EXPECTF-- -*** Testing strspn() : error conditions *** - --- Testing strspn() function with Zero arguments -- - -Warning: strspn() expects at least 2 parameters, 0 given in %s on line %d -NULL - --- Testing strspn() function with more than expected no. of arguments -- - -Warning: strspn() expects at most 4 parameters, 5 given in %s on line %d -NULL - --- Testing strspn() function with less than expected no. of arguments -- - -Warning: strspn() expects at least 2 parameters, 1 given in %s on line %d -NULL -Done diff --git a/ext/standard/tests/strings/strtok_error.phpt b/ext/standard/tests/strings/strtok_error.phpt deleted file mode 100644 index b54fbbe19b..0000000000 --- a/ext/standard/tests/strings/strtok_error.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Test strtok() function : error conditions ---FILE-- -<?php -/* Prototype : string strtok ( string $str, string $token ) - * Description: splits a string (str) into smaller strings (tokens), with each token being delimited by any character from token - * Source code: ext/standard/string.c -*/ - -/* - * Testing strtok() for error conditions -*/ - -echo "*** Testing strtok() : error conditions ***\n"; - -// Zero argument -echo "\n-- Testing strtok() function with Zero arguments --\n"; -var_dump( strtok() ); - -// More than expected number of arguments -echo "\n-- Testing strtok() function with more than expected no. of arguments --\n"; -$str = 'sample string'; -$token = ' '; -$extra_arg = 10; - -var_dump( strtok($str, $token, $extra_arg) ); -var_dump( $str ); - -// Less than expected number of arguments -echo "\n-- Testing strtok() with less than expected no. of arguments --\n"; -$str = 'string val'; - -var_dump( strtok($str)); -var_dump( $str ); - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing strtok() : error conditions *** - --- Testing strtok() function with Zero arguments -- - -Warning: strtok() expects at least 1 parameter, 0 given in %s on line %d -NULL - --- Testing strtok() function with more than expected no. of arguments -- - -Warning: strtok() expects at most 2 parameters, 3 given in %s on line %d -NULL -string(13) "sample string" - --- Testing strtok() with less than expected no. of arguments -- -bool(false) -string(10) "string val" -Done diff --git a/ext/standard/tests/strings/strtr_error.phpt b/ext/standard/tests/strings/strtr_error.phpt deleted file mode 100644 index 0d4d157776..0000000000 --- a/ext/standard/tests/strings/strtr_error.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Test strtr() function : error conditions ---FILE-- -<?php -/* Prototype : string strtr(string str, string from[, string to]) - * Description: Translates characters in str using given translation tables - * Source code: ext/standard/string.c -*/ - -echo "*** Testing strtr() : error conditions ***\n"; -$str = "string"; -$from = "string"; -$to = "STRING"; -$extra_arg = "extra_argument"; - -echo "\n-- Testing strtr() function with Zero arguments --"; -var_dump( strtr() ); - -echo "\n-- Testing strtr() function with less than expected no. of arguments --"; -var_dump( strtr($str) ); - -echo "\n-- Testing strtr() function with more than expected no. of arguments --"; -var_dump( strtr($str, $from, $to, $extra_arg) ); - -echo "Done"; -?> ---EXPECTF-- -*** Testing strtr() : error conditions *** - --- Testing strtr() function with Zero arguments -- -Warning: strtr() expects at least 2 parameters, 0 given in %s on line %d -NULL - --- Testing strtr() function with less than expected no. of arguments -- -Warning: strtr() expects at least 2 parameters, 1 given in %s on line %d -NULL - --- Testing strtr() function with more than expected no. of arguments -- -Warning: strtr() expects at most 3 parameters, 4 given in %s on line %d -NULL -Done diff --git a/ext/standard/tests/strings/ucwords_error.phpt b/ext/standard/tests/strings/ucwords_error.phpt deleted file mode 100644 index 7ada10c629..0000000000 --- a/ext/standard/tests/strings/ucwords_error.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Test ucwords() function : error conditions ---FILE-- -<?php -/* Prototype : string ucwords ( string $str ) - * Description: Uppercase the first character of each word in a string - * Source code: ext/standard/string.c -*/ - -echo "*** Testing ucwords() : error conditions ***\n"; - -// Zero argument -echo "\n-- Testing ucwords() function with Zero arguments --\n"; -var_dump( ucwords() ); - -// More than expected number of arguments -echo "\n-- Testing ucwords() function with more than expected no. of arguments --\n"; -$str = 'string_val'; -$extra_arg = 10; - -var_dump( ucwords($str, $extra_arg, $extra_arg) ); - -// check if there were any changes made to $str -var_dump($str); - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing ucwords() : error conditions *** - --- Testing ucwords() function with Zero arguments -- - -Warning: ucwords() expects at least 1 parameter, 0 given in %s on line %d -NULL - --- Testing ucwords() function with more than expected no. of arguments -- - -Warning: ucwords() expects at most 2 parameters, 3 given in %s on line %d -NULL -string(10) "string_val" -Done diff --git a/ext/standard/tests/strings/utf8_decode_error.phpt b/ext/standard/tests/strings/utf8_decode_error.phpt deleted file mode 100644 index de2ca2b80e..0000000000 --- a/ext/standard/tests/strings/utf8_decode_error.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Test utf8_decode() function : error conditions ---FILE-- -<?php -/* Prototype : proto string utf8_decode(string data) - * Description: Converts a UTF-8 encoded string to ISO-8859-1 - * Source code: ext/standard/string.c - * Alias to functions: - */ - -echo "*** Testing utf8_decode() : error conditions ***\n"; - -// Zero arguments -echo "\n-- Testing utf8_decode() function with Zero arguments --\n"; -var_dump( utf8_decode() ); - -//Test utf8_decode with one more than the expected number of arguments -echo "\n-- Testing utf8_decode() function with more than expected no. of arguments --\n"; -$data = 'string_val'; -$extra_arg = 10; -var_dump( utf8_decode($data, $extra_arg) ); - -echo "Done"; -?> ---EXPECTF-- -*** Testing utf8_decode() : error conditions *** - --- Testing utf8_decode() function with Zero arguments -- - -Warning: utf8_decode() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing utf8_decode() function with more than expected no. of arguments -- - -Warning: utf8_decode() expects exactly 1 parameter, 2 given in %s on line %d -NULL -Done diff --git a/ext/standard/tests/strings/utf8_encode_error.phpt b/ext/standard/tests/strings/utf8_encode_error.phpt deleted file mode 100644 index bcc9335c58..0000000000 --- a/ext/standard/tests/strings/utf8_encode_error.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Test utf8_encode() function : error conditions ---FILE-- -<?php -/* Prototype : proto string utf8_encode(string data) - * Description: Encodes an ISO-8859-1 string to UTF-8 - * Source code: ext/standard/string.c - * Alias to functions: - */ - -echo "*** Testing utf8_encode() : error conditions ***\n"; - -// Zero arguments -echo "\n-- Testing utf8_encode() function with Zero arguments --\n"; -var_dump( utf8_encode() ); - -//Test utf8_encode with one more than the expected number of arguments -echo "\n-- Testing utf8_encode() function with more than expected no. of arguments --\n"; -$data = 'string_val'; -$extra_arg = 10; -var_dump( utf8_encode($data, $extra_arg) ); - -echo "Done"; -?> ---EXPECTF-- -*** Testing utf8_encode() : error conditions *** - --- Testing utf8_encode() function with Zero arguments -- - -Warning: utf8_encode() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing utf8_encode() function with more than expected no. of arguments -- - -Warning: utf8_encode() expects exactly 1 parameter, 2 given in %s on line %d -NULL -Done diff --git a/ext/standard/tests/strings/vfprintf_error2.phpt b/ext/standard/tests/strings/vfprintf_error2.phpt deleted file mode 100644 index 7da28468b3..0000000000 --- a/ext/standard/tests/strings/vfprintf_error2.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -Test vfprintf() function : error conditions (less than expected arguments) ---CREDITS-- -Felix De Vliegher <felix.devliegher@gmail.com> ---INI-- -precision=14 ---FILE-- -<?php -/* Prototype : int vfprintf(resource stream, string format, array args) - * Description: Output a formatted string into a stream - * Source code: ext/standard/formatted_print.c - * Alias to functions: - */ - -// Open handle -$file = 'vfprintf_error2.txt'; -$fp = fopen( $file, "a+" ); - -echo "\n-- Testing vfprintf() function with less than expected no. of arguments --\n"; -$format = 'string_val'; -var_dump( vfprintf($fp, $format) ); -var_dump( vfprintf( $fp ) ); -var_dump( vfprintf() ); - -// Close handle -fclose($fp); - -?> -===DONE=== ---CLEAN-- -<?php - -$file = 'vfprintf_error2.txt'; -unlink( $file ); - -?> ---EXPECTF-- --- Testing vfprintf() function with less than expected no. of arguments -- - -Warning: Wrong parameter count for vfprintf() in %s on line %d -NULL - -Warning: Wrong parameter count for vfprintf() in %s on line %d -NULL - -Warning: Wrong parameter count for vfprintf() in %s on line %d -NULL -===DONE=== diff --git a/ext/standard/tests/strings/vprintf_error.phpt b/ext/standard/tests/strings/vprintf_error.phpt deleted file mode 100644 index 070b1b086c..0000000000 --- a/ext/standard/tests/strings/vprintf_error.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Test vprintf() function : error conditions ---FILE-- -<?php -/* Prototype : int vprintf(string $format , array $args) - * Description: Output a formatted string - * Source code: ext/standard/formatted_print.c - */ - -echo "*** Testing vprintf() : error conditions ***\n"; - -// initialising the required variables -$format = "%s"; -$args = array("hello"); -$extra_arg = "extra arg"; - -// Zero arguments -echo "\n-- Testing vprintf() function with Zero arguments --\n"; -var_dump( vprintf() ); - -echo "\n-- Testing vprintf() function with less than expected no. of arguments --\n"; -var_dump( vprintf($format) ); - -echo "\n-- testing vprintf() function with more than expected no. of arguments --\n"; -var_dump( vprintf($format, $args, $extra_arg) ); - -?> -===DONE=== ---EXPECTF-- -*** Testing vprintf() : error conditions *** - --- Testing vprintf() function with Zero arguments -- - -Warning: vprintf() expects exactly 2 parameters, 0 given in %s on line %d -bool(false) - --- Testing vprintf() function with less than expected no. of arguments -- - -Warning: vprintf() expects exactly 2 parameters, 1 given in %s on line %d -bool(false) - --- testing vprintf() function with more than expected no. of arguments -- - -Warning: vprintf() expects exactly 2 parameters, 3 given in %s on line %d -bool(false) -===DONE=== diff --git a/ext/standard/tests/strings/vsprintf_error.phpt b/ext/standard/tests/strings/vsprintf_error.phpt deleted file mode 100644 index 2fe85f09f4..0000000000 --- a/ext/standard/tests/strings/vsprintf_error.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Test vsprintf() function : error conditions ---FILE-- -<?php -/* Prototype : string vsprintf(string $format , array $args) - * Description: Return a formatted string - * Source code: ext/standard/formatted_print.c - */ - -echo "*** Testing vsprintf() : error conditions ***\n"; - -// initialising the required variables -$format = "%s"; -$args = array("hello"); -$extra_arg = "extra arg"; - -// Zero arguments -echo "\n-- Testing vsprintf() function with Zero arguments --\n"; -var_dump( vsprintf() ); - -echo "\n-- Testing vsprintf() function with less than expected no. of arguments --\n"; -var_dump( vsprintf($format) ); - -echo "\n-- testing vsprintf() function with more than expected no. of arguments --\n"; -var_dump( vsprintf($format, $args, $extra_arg) ); - -echo "Done"; -?> ---EXPECTF-- -*** Testing vsprintf() : error conditions *** - --- Testing vsprintf() function with Zero arguments -- - -Warning: vsprintf() expects exactly 2 parameters, 0 given in %s on line %d -bool(false) - --- Testing vsprintf() function with less than expected no. of arguments -- - -Warning: vsprintf() expects exactly 2 parameters, 1 given in %s on line %d -bool(false) - --- testing vsprintf() function with more than expected no. of arguments -- - -Warning: vsprintf() expects exactly 2 parameters, 3 given in %s on line %d -bool(false) -Done |