From: andy wharmby Date: Mon, 19 Jan 2009 15:46:36 +0000 (+0000) Subject: New tests for str_pad(), str_shuffle(), stristr() and strlen(). Tested on WIndows... X-Git-Tag: php-5.4.0alpha1~191^2~4468 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8be7bef0a6e50ec5fc34d6ca96f1b77714d51949;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..d1c938f8d9 --- /dev/null +++ b/ext/standard/tests/strings/str_pad_variation1.phpt @@ -0,0 +1,140 @@ +--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 -- +unicode(20) "0 " +-- Iteration 2 -- +unicode(20) "1 " +-- Iteration 3 -- +unicode(20) "-2 " +-- Iteration 4 -- +unicode(20) "2147483647 " +-- Iteration 5 -- +unicode(20) "-2147483648 " +-- Iteration 6 -- +unicode(20) "10.5 " +-- Iteration 7 -- +unicode(20) "-20.5 " +-- Iteration 8 -- +unicode(20) "101234567000 " +-- Iteration 9 -- + +Warning: str_pad() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 10 -- + +Warning: str_pad() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 11 -- + +Warning: str_pad() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 12 -- +unicode(20) "1 " +-- Iteration 13 -- +unicode(20) " " +-- Iteration 14 -- +unicode(20) "1 " +-- Iteration 15 -- +unicode(20) " " +-- Iteration 16 -- +unicode(20) " " +-- Iteration 17 -- +unicode(20) " " +-- Iteration 18 -- +unicode(20) "sample object " +-- Iteration 19 -- + +Warning: str_pad() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d +NULL +-- Iteration 20 -- +unicode(20) " " +-- Iteration 21 -- +unicode(20) " " +===DONE=== \ No newline at end of file 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..6210051917 --- /dev/null +++ b/ext/standard/tests/strings/str_pad_variation2.phpt @@ -0,0 +1,139 @@ +--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 -- +unicode(11) "Test string" +-- Iteration 2 -- +unicode(11) "Test string" +-- Iteration 3 -- +unicode(11) "Test string" +-- Iteration 4 -- +unicode(255) "Test string " +-- Iteration 5 -- +unicode(11) "Test string" +-- Iteration 6 -- +unicode(11) "Test string" +-- Iteration 7 -- +unicode(1012) "Test string " +-- Iteration 8 -- + +Warning: str_pad() expects parameter 2 to be long, array given in %s on line %d +NULL +-- Iteration 9 -- + +Warning: str_pad() expects parameter 2 to be long, array given in %s on line %d +NULL +-- Iteration 10 -- + +Warning: str_pad() expects parameter 2 to be long, array given in %s on line %d +NULL +-- Iteration 11 -- +unicode(11) "Test string" +-- Iteration 12 -- +unicode(11) "Test string" +-- Iteration 13 -- +unicode(11) "Test string" +-- Iteration 14 -- +unicode(11) "Test string" +-- Iteration 15 -- +unicode(11) "Test string" +-- Iteration 16 -- +unicode(11) "Test string" +-- Iteration 17 -- + +Warning: str_pad() expects parameter 2 to be long, object given in %s on line %d +NULL +-- Iteration 18 -- + +Warning: str_pad() expects parameter 2 to be long, resource given in %s on line %d +NULL +-- Iteration 19 -- +unicode(11) "Test string" +-- Iteration 20 -- +unicode(11) "Test string" +===DONE=== \ No newline at end of file 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..6e253d06f9 --- /dev/null +++ b/ext/standard/tests/strings/str_pad_variation3.phpt @@ -0,0 +1,153 @@ +--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 -- +unicode(20) "Test string000000000" +-- Iteration 2 -- +unicode(20) "Test string111111111" +-- Iteration 3 -- +unicode(20) "Test string-2-2-2-2-" +-- Iteration 4 -- +unicode(20) "Test string214748364" +-- Iteration 5 -- +unicode(20) "Test string-21474836" +-- Iteration 6 -- +unicode(20) "Test string10.510.51" +-- Iteration 7 -- +unicode(20) "Test string-20.5-20." +-- Iteration 8 -- +unicode(20) "Test string101234567" +-- Iteration 9 -- + +Warning: str_pad() expects parameter 3 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 10 -- + +Warning: str_pad() expects parameter 3 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 11 -- + +Warning: str_pad() expects parameter 3 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 12 -- +unicode(20) "Test string111111111" +-- Iteration 13 -- + +Warning: str_pad(): Padding string cannot be empty in %s on line %d +NULL +-- Iteration 14 -- +unicode(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 -- +unicode(20) "Test stringsample ob" +-- Iteration 19 -- + +Warning: str_pad() expects parameter 3 to be string (Unicode or binary), resource given in %s on line %d +NULL +-- 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=== \ No newline at end of file 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..e99670a789 --- /dev/null +++ b/ext/standard/tests/strings/str_pad_variation4.phpt @@ -0,0 +1,168 @@ +--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 -- +unicode(20) "*********Test string" +-- Iteration 2 -- +unicode(20) "Test string*********" +-- Iteration 3 -- +unicode(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 -- + +Warning: str_pad() expects parameter 4 to be long, Unicode string given in %s on line %d +NULL +-- Iteration 11 -- + +Warning: str_pad() expects parameter 4 to be long, Unicode string given in %s on line %d +NULL +-- Iteration 12 -- +unicode(20) "****Test string*****" +-- Iteration 13 -- +unicode(20) "****Test string*****" +-- Iteration 14 -- +unicode(20) "****Test string*****" +-- Iteration 15 -- + +Warning: str_pad() expects parameter 4 to be long, array given in %s on line %d +NULL +-- Iteration 16 -- + +Warning: str_pad() expects parameter 4 to be long, array given in %s on line %d +NULL +-- Iteration 17 -- + +Warning: str_pad() expects parameter 4 to be long, array given in %s on line %d +NULL +-- Iteration 18 -- +unicode(20) "Test string*********" +-- Iteration 19 -- +unicode(20) "*********Test string" +-- Iteration 20 -- +unicode(20) "Test string*********" +-- Iteration 21 -- +unicode(20) "*********Test string" +-- Iteration 22 -- +unicode(20) "*********Test string" +-- Iteration 23 -- +unicode(20) "*********Test string" +-- Iteration 24 -- + +Warning: str_pad() expects parameter 4 to be long, object given in %s on line %d +NULL +-- Iteration 25 -- +unicode(20) "*********Test string" +-- Iteration 26 -- +unicode(20) "*********Test string" +===DONE=== \ No newline at end of file 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..d78bccafeb --- /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 4294967272 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..7de07ddcf4 --- /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 *** +unicode(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..d8024290e0 --- /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: 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=== \ No newline at end of file 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..6a242e1eff --- /dev/null +++ b/ext/standard/tests/strings/str_shuffle_variation1.phpt @@ -0,0 +1,135 @@ +--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 -- +unicode(1) "0" +-- Iteration 2 -- +unicode(1) "1" +-- Iteration 3 -- +unicode(2) "%s" +-- Iteration 4 -- +unicode(10) "%s" +-- Iteration 5 -- +unicode(11) "%s" +-- Iteration 6 -- +unicode(4) "%s" +-- Iteration 7 -- +unicode(5) "%s" +-- Iteration 8 -- +unicode(12) "%s" +-- Iteration 9 -- + +Warning: str_shuffle() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 10 -- + +Warning: str_shuffle() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 11 -- + +Warning: str_shuffle() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 12 -- +unicode(1) "1" +-- Iteration 13 -- +unicode(0) "" +-- Iteration 14 -- +unicode(1) "1" +-- Iteration 15 -- +unicode(0) "" +-- Iteration 16 -- +unicode(0) "" +-- Iteration 17 -- +unicode(0) "" +-- Iteration 18 -- +unicode(13) "%s" +-- Iteration 19 -- + +Warning: str_shuffle() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d +NULL +-- Iteration 20 -- +unicode(0) "" +-- Iteration 21 -- +unicode(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..6ba8aec643 --- /dev/null +++ b/ext/standard/tests/strings/stristr_basic.phpt @@ -0,0 +1,36 @@ +--TEST-- +Test stristr() function : basic functionality +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing stristr() : basic functionality *** +unicode(11) "Test string" +unicode(6) "stRIng" +unicode(6) "StrinG" +unicode(8) "T string" +unicode(1) "G" +unicode(6) "005374" +unicode(4) "tEst" +unicode(4) "teSt" +unicode(6) "String" +unicode(5) "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..831d93f4ec --- /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: stristr() expects at least 2 parameters, 0 given in %s on line %d +NULL + +Warning: stristr() expects at least 2 parameters, 1 given in %s on line %d +NULL + +-- Testing stristr() function with no needle -- + +Warning: stristr() expects at least 2 parameters, 1 given in %s on line %d +NULL + +-- Testing stristr() function with more than expected no. of arguments -- + +Warning: stristr() expects at most 3 parameters, 4 given 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..a2c821df61 --- /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 -- +unicode(7) " object" +-- Iteration 18 -- +unicode(%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..1f6f2da4f6 --- /dev/null +++ b/ext/standard/tests/strings/stristr_variation2.phpt @@ -0,0 +1,135 @@ +--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 -- + +Warning: Needle argument codepoint value out of range (0 - 0x10FFFF) in %s on line %d +bool(false) +-- Iteration 4 -- + +Warning: Needle argument codepoint value out of range (0 - 0x10FFFF) in %s on line %d +bool(false) +-- Iteration 5 -- +bool(false) +-- Iteration 6 -- + +Warning: Needle argument codepoint value out of range (0 - 0x10FFFF) in %s on line %d +bool(false) +-- Iteration 7 -- + +Warning: Needle argument codepoint value out of range (0 - 0x10FFFF) in %s on line %d +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 -- +bool(false) +-- 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..552e7c1ca6 --- /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: strlen() expects exactly 1 parameter, 0 given in %s on line %d +NULL + +-- Testing strlen() function with more than expected no. of arguments -- + +Warning: strlen() expects exactly 1 parameter, 2 given 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..872130e464 --- /dev/null +++ b/ext/standard/tests/strings/strlen_variation1.phpt @@ -0,0 +1,137 @@ +--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 -- + +Warning: strlen() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 10 -- + +Warning: strlen() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 11 -- + +Warning: strlen() expects parameter 1 to be string (Unicode or binary), 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 (Unicode or binary), resource given in %s on line %d +NULL +-- Iteration 20 -- +int(0) +-- Iteration 21 -- +int(0) +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/strings/strtr_variation5.phpt b/ext/standard/tests/strings/strtr_variation5.phpt index 91d9a816aa..ba760d4e11 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 @@ unicode(4) "ta.5" -- Iteration 5 -- unicode(5) "-ma.5" -- Iteration 6 -- -unicode(12) "ta5aaaaaaaaa" +unicode(12) "tatm34567aaa" -- Iteration 7 -- Warning: strtr() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d @@ -136,4 +136,4 @@ NULL unicode(0) "" -- Iteration 19 -- unicode(0) "" -*** Done *** +===DONE=== diff --git a/ext/standard/tests/strings/strtr_variation6.phpt b/ext/standard/tests/strings/strtr_variation6.phpt index 65149d462c..01982fc91a 100644 --- a/ext/standard/tests/strings/strtr_variation6.phpt +++ b/ext/standard/tests/strings/strtr_variation6.phpt @@ -1,5 +1,5 @@ --TEST-- -Test strtr() function : usage variations - unexpected inputs for 'from' argument(Bug #42861) +Test strtr() function : usage variations - unexpected inputs for 'from' argument --FILE-- +===DONE=== --EXPECTF-- *** Testing strtr() function: with unexpected inputs for 'from' *** -- Iteration 1 -- @@ -101,7 +100,7 @@ unicode(6) "ta2atm" -- Iteration 5 -- unicode(6) "m1tatm" -- Iteration 6 -- -unicode(6) "2a2atm" +unicode(6) "tm0atm" -- Iteration 7 -- Notice: Array to string conversion in %s on line %d @@ -134,4 +133,4 @@ unicode(6) "012atm" unicode(6) "012atm" -- Iteration 19 -- unicode(6) "012atm" -*** Done *** +===DONE=== diff --git a/ext/standard/tests/strings/strtr_variation7.phpt b/ext/standard/tests/strings/strtr_variation7.phpt index c3706752b9..d0923fd0c4 100644 --- a/ext/standard/tests/strings/strtr_variation7.phpt +++ b/ext/standard/tests/strings/strtr_variation7.phpt @@ -1,5 +1,5 @@ --TEST-- -Test strtr() function : usage variations - unexpected inputs for 'to' argument(Bug #42861) +Test strtr() function : usage variations - unexpected inputs for 'to' argument --FILE-- +===DONE=== --EXPECTF-- *** Testing strtr() function: with unexpected inputs for 'to' *** @@ -107,7 +107,7 @@ unicode(6) "51210." unicode(6) ".52-20" -- Iteration 6 -- -unicode(6) "000105" +unicode(6) "234101" -- Iteration 7 -- @@ -155,4 +155,4 @@ unicode(6) "012atm" -- Iteration 19 -- unicode(6) "012atm" -*** Done *** +===DONE=== diff --git a/ext/standard/tests/strings/strtr_variation9.phpt b/ext/standard/tests/strings/strtr_variation9.phpt index a9c1353dc3..fb8d1b3d90 100644 --- a/ext/standard/tests/strings/strtr_variation9.phpt +++ b/ext/standard/tests/strings/strtr_variation9.phpt @@ -19,7 +19,7 @@ unset($unset_var); //defining a class class sample { public function __toString() { - return "My String"; + return "sample object"; } } @@ -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 -- -unicode(12) "105000000000" +unicode(12) "101234567000" Warning: strtr(): The second argument is not an array in %s on line %d bool(false) @@ -198,7 +198,7 @@ Warning: strtr(): The second argument is not an array in %s on line %d bool(false) -- Iteration 18 -- -unicode(9) "My String" +unicode(13) "sample object" Warning: strtr(): The second argument is not an array in %s on line %d bool(false) @@ -222,4 +222,4 @@ unicode(0) "" Warning: strtr(): The second argument is not an array in %s on line %d bool(false) -*** Done *** +===DONE===