From: andy wharmby Date: Mon, 19 Jan 2009 15:46:31 +0000 (+0000) Subject: New tests for str_pad(), str_shuffle(), stristr() and strlen(). Tested on WIndows... X-Git-Tag: php-5.2.9RC1~85 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=64c8147b91d37193508fc8e5800f61d9c64a59fd;p=php New tests for str_pad(), str_shuffle(), stristr() and strlen(). Tested on WIndows, Linux and Linux 64 bit --- diff --git a/ext/standard/tests/strings/str_pad_variation1.phpt b/ext/standard/tests/strings/str_pad_variation1.phpt new file mode 100644 index 0000000000..4320661e43 --- /dev/null +++ b/ext/standard/tests/strings/str_pad_variation1.phpt @@ -0,0 +1,138 @@ +--TEST-- +Test str_pad() function : usage variations - unexpected inputs for '$input' argument +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing str_pad() function: with unexpected inputs for 'input' argument *** +-- Iteration 1 -- +string(20) "0 " +-- Iteration 2 -- +string(20) "1 " +-- Iteration 3 -- +string(20) "-2 " +-- Iteration 4 -- +string(20) "2147483647 " +-- Iteration 5 -- +string(20) "-2147483648 " +-- Iteration 6 -- +string(20) "10.5 " +-- Iteration 7 -- +string(20) "-20.5 " +-- Iteration 8 -- +string(20) "101234567000 " +-- Iteration 9 -- + +Notice: Array to string conversion in %s on line %d +string(20) "Array " +-- Iteration 10 -- + +Notice: Array to string conversion in %s on line %d +string(20) "Array " +-- Iteration 11 -- + +Notice: Array to string conversion in %s on line %d +string(20) "Array " +-- Iteration 12 -- +string(20) "1 " +-- Iteration 13 -- +string(20) " " +-- Iteration 14 -- +string(20) "1 " +-- Iteration 15 -- +string(20) " " +-- Iteration 16 -- +string(20) " " +-- Iteration 17 -- +string(20) " " +-- Iteration 18 -- +string(20) "sample object " +-- Iteration 19 -- +string(%d) "Resource id #%d%S" +-- Iteration 20 -- +string(20) " " +-- Iteration 21 -- +string(20) " " +===DONE=== diff --git a/ext/standard/tests/strings/str_pad_variation2.phpt b/ext/standard/tests/strings/str_pad_variation2.phpt new file mode 100644 index 0000000000..d7d34954e2 --- /dev/null +++ b/ext/standard/tests/strings/str_pad_variation2.phpt @@ -0,0 +1,131 @@ +--TEST-- +Test str_pad() function : usage variations - unexpected inputs for '$pad_length' argument +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing str_pad() function: with unexpected inputs for 'pad_length' argument *** +-- Iteration 1 -- +string(11) "Test string" +-- Iteration 2 -- +string(11) "Test string" +-- Iteration 3 -- +string(11) "Test string" +-- Iteration 4 -- +string(255) "Test string " +-- Iteration 5 -- +string(11) "Test string" +-- Iteration 6 -- +string(11) "Test string" +-- Iteration 7 -- +string(1012) "Test string " +-- Iteration 8 -- +string(11) "Test string" +-- Iteration 9 -- +string(11) "Test string" +-- Iteration 10 -- +string(11) "Test string" +-- Iteration 11 -- +string(11) "Test string" +-- Iteration 12 -- +string(11) "Test string" +-- Iteration 13 -- +string(11) "Test string" +-- Iteration 14 -- +string(11) "Test string" +-- Iteration 15 -- +string(11) "Test string" +-- Iteration 16 -- +string(11) "Test string" +-- Iteration 17 -- + +Notice: Object of class sample could not be converted to int in %s on line %d +string(11) "Test string" +-- Iteration 18 -- +string(%d) "Test string%S" +-- Iteration 19 -- +string(11) "Test string" +-- Iteration 20 -- +string(11) "Test string" +===DONE=== diff --git a/ext/standard/tests/strings/str_pad_variation3.phpt b/ext/standard/tests/strings/str_pad_variation3.phpt new file mode 100644 index 0000000000..9cf3d1ce67 --- /dev/null +++ b/ext/standard/tests/strings/str_pad_variation3.phpt @@ -0,0 +1,151 @@ +--TEST-- +Test str_pad() function : usage variations - unexpected inputs for '$pad_string' argument +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing str_pad() function: with unexpected inputs for 'pad_string' argument *** +-- Iteration 1 -- +string(20) "Test string000000000" +-- Iteration 2 -- +string(20) "Test string111111111" +-- Iteration 3 -- +string(20) "Test string-2-2-2-2-" +-- Iteration 4 -- +string(20) "Test string214748364" +-- Iteration 5 -- +string(20) "Test string-21474836" +-- Iteration 6 -- +string(20) "Test string10.510.51" +-- Iteration 7 -- +string(20) "Test string-20.5-20." +-- Iteration 8 -- +string(20) "Test string101234567" +-- Iteration 9 -- + +Notice: Array to string conversion in %s on line %d +string(20) "Test stringArrayArra" +-- Iteration 10 -- + +Notice: Array to string conversion in %s on line %d +string(20) "Test stringArrayArra" +-- Iteration 11 -- + +Notice: Array to string conversion in %s on line %d +string(20) "Test stringArrayArra" +-- Iteration 12 -- +string(20) "Test string111111111" +-- Iteration 13 -- + +Warning: str_pad(): Padding string cannot be empty in %s on line %d +NULL +-- Iteration 14 -- +string(20) "Test string111111111" +-- Iteration 15 -- + +Warning: str_pad(): Padding string cannot be empty in %s on line %d +NULL +-- Iteration 16 -- + +Warning: str_pad(): Padding string cannot be empty in %s on line %d +NULL +-- Iteration 17 -- + +Warning: str_pad(): Padding string cannot be empty in %s on line %d +NULL +-- Iteration 18 -- +string(20) "Test stringsample ob" +-- Iteration 19 -- +string(20) "Test stringResource " +-- Iteration 20 -- + +Warning: str_pad(): Padding string cannot be empty in %s on line %d +NULL +-- Iteration 21 -- + +Warning: str_pad(): Padding string cannot be empty in %s on line %d +NULL +===DONE=== diff --git a/ext/standard/tests/strings/str_pad_variation4.phpt b/ext/standard/tests/strings/str_pad_variation4.phpt new file mode 100644 index 0000000000..949c615b26 --- /dev/null +++ b/ext/standard/tests/strings/str_pad_variation4.phpt @@ -0,0 +1,158 @@ +--TEST-- +Test str_pad() function : usage variations - unexpected inputs for '$pad_type' argument +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing str_pad() function: with unexpected inputs for 'pad_type' argument *** +-- Iteration 1 -- +string(20) "*********Test string" +-- Iteration 2 -- +string(20) "Test string*********" +-- Iteration 3 -- +string(20) "****Test string*****" +-- Iteration 4 -- + +Warning: str_pad(): Padding type has to be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH in %s on line %d +NULL +-- Iteration 5 -- + +Warning: str_pad(): Padding type has to be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH in %s on line %d +NULL +-- Iteration 6 -- + +Warning: str_pad(): Padding type has to be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH in %s on line %d +NULL +-- Iteration 7 -- + +Warning: str_pad(): Padding type has to be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH in %s on line %d +NULL +-- Iteration 8 -- + +Warning: str_pad(): Padding type has to be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH in %s on line %d +NULL +-- Iteration 9 -- + +Warning: str_pad(): Padding type has to be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH in %s on line %d +NULL +-- Iteration 10 -- +string(20) "*********Test string" +-- Iteration 11 -- +string(20) "*********Test string" +-- Iteration 12 -- +string(20) "****Test string*****" +-- Iteration 13 -- +string(20) "*********Test string" +-- Iteration 14 -- +string(20) "****Test string*****" +-- Iteration 15 -- +string(20) "*********Test string" +-- Iteration 16 -- +string(20) "Test string*********" +-- Iteration 17 -- +string(20) "Test string*********" +-- Iteration 18 -- +string(20) "Test string*********" +-- Iteration 19 -- +string(20) "*********Test string" +-- Iteration 20 -- +string(20) "Test string*********" +-- Iteration 21 -- +string(20) "*********Test string" +-- Iteration 22 -- +string(20) "*********Test string" +-- Iteration 23 -- +string(20) "*********Test string" +-- Iteration 24 -- + +Notice: Object of class sample could not be converted to int in %s on line %d +string(20) "Test string*********" +-- Iteration 25 -- +string(20) "*********Test string" +-- Iteration 26 -- +string(20) "*********Test string" +===DONE=== diff --git a/ext/standard/tests/strings/str_pad_variation5.phpt b/ext/standard/tests/strings/str_pad_variation5.phpt new file mode 100644 index 0000000000..3db2393e84 --- /dev/null +++ b/ext/standard/tests/strings/str_pad_variation5.phpt @@ -0,0 +1,31 @@ +--TEST-- +Test str_pad() function : usage variations - unexpected large value for '$pad_length' argument +--INI-- +memory_limit=128M +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing str_pad() function: with large value for for 'pad_length' argument *** + +Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 2147483648 bytes) in %s on line %d \ No newline at end of file diff --git a/ext/standard/tests/strings/str_shuffle_basic.phpt b/ext/standard/tests/strings/str_shuffle_basic.phpt new file mode 100644 index 0000000000..b60a35f560 --- /dev/null +++ b/ext/standard/tests/strings/str_shuffle_basic.phpt @@ -0,0 +1,59 @@ +--TEST-- +Test str_shuffle() function : basic functionality +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing str_shuffle() : basic functionality *** +string(47) "%s" +TEST PASSED +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/strings/str_shuffle_error.phpt b/ext/standard/tests/strings/str_shuffle_error.phpt new file mode 100644 index 0000000000..f2feef9b57 --- /dev/null +++ b/ext/standard/tests/strings/str_shuffle_error.phpt @@ -0,0 +1,33 @@ +--TEST-- +Test str_shuffle() function : error conditions +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing str_shuffle() : error conditions *** + +-- Testing str_shuffle() function with no arguments -- + +Warning: Wrong parameter count for str_shuffle() in %s on line %d +NULL + +-- Testing str_shuffle() function with more than expected no. of arguments -- + +Warning: Wrong parameter count for str_shuffle() in %s on line %d +NULL +===DONE=== diff --git a/ext/standard/tests/strings/str_shuffle_variation1.phpt b/ext/standard/tests/strings/str_shuffle_variation1.phpt new file mode 100644 index 0000000000..a62eea010d --- /dev/null +++ b/ext/standard/tests/strings/str_shuffle_variation1.phpt @@ -0,0 +1,133 @@ +--TEST-- +Test str_shuffle() function : usage variations - test values for $haystack argument +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing str_shuffle() function: with unexpected inputs for 'string' argument *** +-- Iteration 1 -- +string(1) "0" +-- Iteration 2 -- +string(1) "1" +-- Iteration 3 -- +string(2) "%s" +-- Iteration 4 -- +string(10) "%s" +-- Iteration 5 -- +string(11) "%s" +-- Iteration 6 -- +string(4) "%s" +-- Iteration 7 -- +string(5) "%s" +-- Iteration 8 -- +string(12) "%s" +-- Iteration 9 -- + +Notice: Array to string conversion in %s on line %d +string(5) "%s" +-- Iteration 10 -- + +Notice: Array to string conversion in %s on line %d +string(5) "%s" +-- Iteration 11 -- + +Notice: Array to string conversion in %s on line %d +string(5) "%s" +-- Iteration 12 -- +string(1) "1" +-- Iteration 13 -- +string(0) "" +-- Iteration 14 -- +string(1) "1" +-- Iteration 15 -- +string(0) "" +-- Iteration 16 -- +string(0) "" +-- Iteration 17 -- +string(0) "" +-- Iteration 18 -- +string(13) "%s" +-- Iteration 19 -- +string(%d) "%s" +-- Iteration 20 -- +string(0) "" +-- Iteration 21 -- +string(0) "" +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/strings/stristr_basic.phpt b/ext/standard/tests/strings/stristr_basic.phpt new file mode 100644 index 0000000000..b3705f3231 --- /dev/null +++ b/ext/standard/tests/strings/stristr_basic.phpt @@ -0,0 +1,31 @@ +--TEST-- +Test stristr() function : basic functionality +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing stristr() : basic functionality *** +string(11) "Test string" +string(6) "stRIng" +string(6) "StrinG" +string(8) "T string" +string(1) "G" +string(6) "005374" +string(4) "tEst" +string(4) "teSt" +===DONE=== diff --git a/ext/standard/tests/strings/stristr_error.phpt b/ext/standard/tests/strings/stristr_error.phpt new file mode 100644 index 0000000000..7256704055 --- /dev/null +++ b/ext/standard/tests/strings/stristr_error.phpt @@ -0,0 +1,60 @@ +--TEST-- +Test stristr() function : error conditions +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing stristr() : error conditions *** + +-- Testing stristr() function with no arguments -- + +Warning: Wrong parameter count for stristr() in %s on line %d +NULL + +Warning: Wrong parameter count for stristr() in %s on line %d +NULL + +-- Testing stristr() function with no needle -- + +Warning: Wrong parameter count for stristr() in %s on line %d +NULL + +-- Testing stristr() function with more than expected no. of arguments -- + +Warning: Wrong parameter count for stristr() in %s on line %d +NULL + +-- Testing stristr() function with empty haystack -- + +Warning: stristr(): Empty delimiter in %s on line %d +bool(false) + +-- Testing stristr() function with empty needle -- + +Warning: stristr(): Empty delimiter in %s on line %d +bool(false) +===DONE=== diff --git a/ext/standard/tests/strings/stristr_variation1.phpt b/ext/standard/tests/strings/stristr_variation1.phpt new file mode 100644 index 0000000000..b50c937266 --- /dev/null +++ b/ext/standard/tests/strings/stristr_variation1.phpt @@ -0,0 +1,131 @@ +--TEST-- +Test stristr() function : usage variations - test values for $haystack argument +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing stristr() function: with unexpected inputs for 'string' argument *** +-- Iteration 1 -- +bool(false) +-- Iteration 2 -- +bool(false) +-- Iteration 3 -- +bool(false) +-- Iteration 4 -- +bool(false) +-- Iteration 5 -- +bool(false) +-- Iteration 6 -- +bool(false) +-- Iteration 7 -- +bool(false) +-- Iteration 8 -- + +Notice: Array to string conversion in %s on line %d2 +bool(false) +-- Iteration 9 -- + +Notice: Array to string conversion in %s on line %d2 +bool(false) +-- Iteration 10 -- + +Notice: Array to string conversion in %s on line %d2 +bool(false) +-- Iteration 11 -- +bool(false) +-- Iteration 12 -- +bool(false) +-- Iteration 13 -- +bool(false) +-- Iteration 14 -- +bool(false) +-- Iteration 15 -- +bool(false) +-- Iteration 16 -- +bool(false) +-- Iteration 17 -- +string(7) " object" +-- Iteration 18 -- +string(%d) " id #%d" +-- Iteration 19 -- +bool(false) +-- Iteration 20 -- +bool(false) +===DONE=== diff --git a/ext/standard/tests/strings/stristr_variation2.phpt b/ext/standard/tests/strings/stristr_variation2.phpt new file mode 100644 index 0000000000..7d1d2feb21 --- /dev/null +++ b/ext/standard/tests/strings/stristr_variation2.phpt @@ -0,0 +1,127 @@ +--TEST-- +Test stristr() function : usage variations - test values for $needle argument +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing stristr() function: with unexpected inputs for 'needle' argument *** +-- Iteration 1 -- +bool(false) +-- Iteration 2 -- +bool(false) +-- Iteration 3 -- +bool(false) +-- Iteration 4 -- +bool(false) +-- Iteration 5 -- +bool(false) +-- Iteration 6 -- +bool(false) +-- Iteration 7 -- +bool(false) +-- Iteration 8 -- +bool(false) +-- Iteration 9 -- +bool(false) +-- Iteration 10 -- +bool(false) +-- Iteration 11 -- +bool(false) +-- Iteration 12 -- +bool(false) +-- Iteration 13 -- +bool(false) +-- Iteration 14 -- +bool(false) +-- Iteration 15 -- +bool(false) +-- Iteration 16 -- +bool(false) +-- Iteration 17 -- + +Notice: Object of class sample could not be converted to int in %s on line %d +bool(false) +-- Iteration 18 -- +%s +-- Iteration 19 -- +bool(false) +-- Iteration 20 -- +bool(false) +===DONE=== diff --git a/ext/standard/tests/strings/strlen_basic.phpt b/ext/standard/tests/strings/strlen_basic.phpt new file mode 100644 index 0000000000..3ed2b97e56 --- /dev/null +++ b/ext/standard/tests/strings/strlen_basic.phpt @@ -0,0 +1,24 @@ +--TEST-- +Test strlen() function : basic functionality +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing strlen() : basic functionality *** +int(6) +int(7) +int(0) +int(18) +===DONE=== diff --git a/ext/standard/tests/strings/strlen_error.phpt b/ext/standard/tests/strings/strlen_error.phpt new file mode 100644 index 0000000000..1e8b975f32 --- /dev/null +++ b/ext/standard/tests/strings/strlen_error.phpt @@ -0,0 +1,33 @@ +--TEST-- +Test strlen() function : error conditions +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing strlen() : unexpected number of arguments *** +-- Testing strlen() function with no arguments -- + +Warning: Wrong parameter count for strlen() in %s on line %d +NULL + +-- Testing strlen() function with more than expected no. of arguments -- + +Warning: Wrong parameter count for strlen() in %s on line %d +NULL +===DONE=== diff --git a/ext/standard/tests/strings/strlen_variation1.phpt b/ext/standard/tests/strings/strlen_variation1.phpt new file mode 100644 index 0000000000..101cf64343 --- /dev/null +++ b/ext/standard/tests/strings/strlen_variation1.phpt @@ -0,0 +1,135 @@ +--TEST-- +Test strlen() function : usage variations - unexpected input for '$string' argument +--FILE-- + +===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 -- + +Notice: Array to string conversion in %s on line %d +int(5) +-- Iteration 10 -- + +Notice: Array to string conversion in %s on line %d +int(5) +-- Iteration 11 -- + +Notice: Array to string conversion in %s on line %d +int(5) +-- 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 -- +int(%d) +-- Iteration 20 -- +int(0) +-- Iteration 21 -- +int(0) +===DONE=== diff --git a/ext/standard/tests/strings/strtr_variation5.phpt b/ext/standard/tests/strings/strtr_variation5.phpt index 7bd1704734..82c86eb292 100644 --- a/ext/standard/tests/strings/strtr_variation5.phpt +++ b/ext/standard/tests/strings/strtr_variation5.phpt @@ -31,42 +31,42 @@ $file_handle = fopen(__FILE__, "r"); // array with different values $strings = array ( - // integer values - 0, - 1, - -2, - - // float values - 10.5, - -20.5, - 10.5e10, - - // array values - array(), - array(0), - array(1, 2), - - // boolean values - true, - false, - TRUE, - FALSE, - - // null vlaues - NULL, - null, - - // objects - new sample(), - - // resource - $file_handle, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var + // integer values +/*1*/ 0, + 1, + -2, + + // float values +/*4*/ 10.5, + -20.5, + 10.1234567e10, + + // array values +/*7*/ array(), + array(0), + array(1, 2), + + // boolean values +/*10*/ true, + false, + TRUE, + FALSE, + + // null vlaues +/*14*/ NULL, + null, + + // objects +/*16*/ new sample(), + + // resource +/*17*/ $file_handle, + + // undefined variable +/*18*/ @$undefined_var, + + // unset variable +/*19*/ @$unset_var ); //defining 'from' argument @@ -86,8 +86,8 @@ for($index = 0; $index < count($strings); $index++) { fclose($file_handle); //closing the file handle -echo "*** Done ***"; ?> +===Done=== --EXPECTF-- *** Testing strtr() function: with unexpected inputs for 'str' *** -- Iteration 1 -- @@ -101,7 +101,7 @@ string(4) "ta.5" -- Iteration 5 -- string(5) "-ma.5" -- Iteration 6 -- -string(12) "ta5aaaaaaaaa" +string(12) "tatm34567aaa" -- Iteration 7 -- Notice: Array to string conversion in %s on line %d @@ -129,9 +129,9 @@ string(0) "" -- Iteration 16 -- string(13) "s02ple objec1" -- Iteration 17 -- -string(%d) "Resource id #%d" +string(%d) "Resource id #%s" -- Iteration 18 -- string(0) "" -- Iteration 19 -- string(0) "" -*** Done *** +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/strings/strtr_variation6.phpt b/ext/standard/tests/strings/strtr_variation6.phpt index 2d8ab71831..9a4463e75f 100644 --- a/ext/standard/tests/strings/strtr_variation6.phpt +++ b/ext/standard/tests/strings/strtr_variation6.phpt @@ -34,42 +34,42 @@ $str = "012atm"; // array of values for 'from' $from_arr = array ( - // integer values - 0, - 1, - -2, - - // float values - 10.5, - -20.5, - 10.5e10, - - // array values - array(), - array(0), - array(1, 2), - - // boolean values - true, - false, - TRUE, - FALSE, - - // null vlaues - NULL, - null, - - // objects - new sample(), - - // resource - $file_handle, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var + // integer values +/*1*/ 0, + 1, + -2, + + // float values +/*4*/ 10.5, + -20.5, + 10.1234567e10, + + // array values +/*7*/ array(), + array(0), + array(1, 2), + + // boolean values +/*10*/ true, + false, + TRUE, + FALSE, + + // null vlaues +/*14*/ NULL, + null, + + // objects +/*16*/ new sample(), + + // resource +/*17*/ $file_handle, + + // undefined variable +/*18*/ @$undefined_var, + + // unset variable +/*19*/ @$unset_var ); //defining 'to' argument @@ -85,9 +85,8 @@ for($index = 0; $index < count($from_arr); $index++) { } fclose($file_handle); //closing the file handle - -echo "*** Done ***"; ?> +===Done=== --EXPECTF-- *** Testing strtr() function: with unexpected inputs for 'from' *** -- Iteration 1 -- @@ -101,7 +100,7 @@ string(6) "ta2atm" -- Iteration 5 -- string(6) "m1tatm" -- Iteration 6 -- -string(6) "2a2atm" +string(6) "tm0atm" -- Iteration 7 -- Notice: Array to string conversion in %s on line %d @@ -134,4 +133,4 @@ string(6) "012atm" string(6) "012atm" -- Iteration 19 -- string(6) "012atm" -*** Done *** +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/strings/strtr_variation7.phpt b/ext/standard/tests/strings/strtr_variation7.phpt index 04b742f312..5a8e9c9ff0 100644 --- a/ext/standard/tests/strings/strtr_variation7.phpt +++ b/ext/standard/tests/strings/strtr_variation7.phpt @@ -37,42 +37,42 @@ $from = "atm012"; // array of values for 'to' argument $to_arr = array ( - // integer values - 0, - 1, - -2, - - // float values - 10.5, - -20.5, - 10.5e10, - - // array values - array(), - array(0), - array(1, 2), - - // boolean values - true, - false, - TRUE, - FALSE, - - // null vlaues - NULL, - null, - - // objects - new sample(), - - // resource - $file_handle, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var + // integer values +/*1*/ 0, + 1, + -2, + + // float values +/*4*/ 10.5, + -20.5, + 10.12345675e10, + + // array values +/*7*/ array(), + array(0), + array(1, 2), + + // boolean values +/*10*/ true, + false, + TRUE, + FALSE, + + // null vlaues +/*14*/ NULL, + null, + + // objects +/*16*/ new sample(), + + // resource +/*17*/ $file_handle, + + // undefined variable +/*18*/ @$undefined_var, + + // unset variable +/*19*/ @$unset_var ); // loop through with each element of the $to array to test strtr() function @@ -86,8 +86,8 @@ for($index = 0; $index < count($to_arr); $index++) { fclose($file_handle); //closing the file handle -echo "*** Done ***"; ?> +===Done=== --EXPECTF-- *** Testing strtr() function: with unexpected inputs for 'to' *** @@ -107,7 +107,7 @@ string(6) "51210." string(6) ".52-20" -- Iteration 6 -- -string(6) "000105" +string(6) "234101" -- Iteration 7 -- @@ -153,4 +153,4 @@ string(6) "012atm" -- Iteration 19 -- string(6) "012atm" -*** Done *** +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/strings/strtr_variation9.phpt b/ext/standard/tests/strings/strtr_variation9.phpt index 0f5875c723..2d4f39f23c 100644 --- a/ext/standard/tests/strings/strtr_variation9.phpt +++ b/ext/standard/tests/strings/strtr_variation9.phpt @@ -29,44 +29,44 @@ $file_handle = fopen(__FILE__, "r"); // array with different values $values = array ( - // integer values - 0, - 1, - -2, - - // float values - 10.5, - -20.5, - 10.5e10, - - // array values - array(), - array(0), - array(1), - array(1, 2), - array('color' => 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // null vlaues - NULL, - null, - - // objects - new sample(), - - // resource - $file_handle, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var + // integer values +/*1*/ 0, + 1, + -2, + + // float values +/*4*/ 10.5, + -20.5, + 10.1234567e10, + + // array values +/*7*/ array(), + array(0), + array(1), + array(1, 2), + array('color' => 'red', 'item' => 'pen'), + + // boolean values +/*12*/ true, + false, + TRUE, + FALSE, + + // null vlaues +/*16*/ NULL, + null, + + // objects +/*18*/ new sample(), + + // resource +/*19*/ $file_handle, + + // undefined variable +/*20*/ @$undefined_var, + + // unset variable +/*21*/ @$unset_var ); // loop through with each element of the $values array to test strtr() function @@ -80,8 +80,8 @@ for($index = 0; $index < count($values); $index++) { fclose($file_handle); //closing the file handle -echo "*** Done ***"; ?> +===Done=== --EXPECTF-- *** Testing strtr() function: with unexpected inputs for all arguments *** @@ -116,7 +116,7 @@ Warning: strtr(): The second argument is not an array in %s on line %d bool(false) -- Iteration 6 -- -string(12) "105000000000" +string(12) "101234567000" Warning: strtr(): The second argument is not an array in %s on line %d bool(false) @@ -240,4 +240,4 @@ string(0) "" Warning: strtr(): The second argument is not an array in %s on line %d bool(false) -*** Done *** +===Done===