From: andy wharmby Date: Sun, 18 Jan 2009 22:51:00 +0000 (+0000) Subject: New nl_langinfo(), number_format() and ord() tests. Tested on Windows. Linux and... X-Git-Tag: php-5.4.0alpha1~191^2~4478 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=be123b0de866b1641671f476a770b28f3b089d65;p=php New nl_langinfo(), number_format() and ord() tests. Tested on Windows. Linux and Linux 64 bit --- diff --git a/ext/standard/tests/strings/nl_langinfo_basic.phpt b/ext/standard/tests/strings/nl_langinfo_basic.phpt new file mode 100644 index 0000000000..f7ba0481f2 --- /dev/null +++ b/ext/standard/tests/strings/nl_langinfo_basic.phpt @@ -0,0 +1,51 @@ +--TEST-- +Test nl_langinfo() function : basic functionality +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing nl_langinfo() : basic functionality *** + +Deprecated: setlocale(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d + +Deprecated: nl_langinfo(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d +string(3) "Mon" + +Deprecated: nl_langinfo(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d +string(9) "Wednesday" + +Deprecated: nl_langinfo(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d +string(3) "Jul" + +Deprecated: nl_langinfo(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d +string(5) "April" + +Deprecated: nl_langinfo(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d +string(1) "." + +Deprecated: setlocale(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/strings/nl_langinfo_error1.phpt b/ext/standard/tests/strings/nl_langinfo_error1.phpt new file mode 100644 index 0000000000..7702b012e9 --- /dev/null +++ b/ext/standard/tests/strings/nl_langinfo_error1.phpt @@ -0,0 +1,40 @@ +--TEST-- +Test nl_langinfo() function : error conditions +--SKIPIF-- + +--FILE-- + +===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 new file mode 100644 index 0000000000..2a283efda7 --- /dev/null +++ b/ext/standard/tests/strings/nl_langinfo_variation1.phpt @@ -0,0 +1,216 @@ +--TEST-- +Test nl_langinfo() function : unexpected inputs for '$tem' argument +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing nl_langinfo() : with unexpected inputs for 'item' argument *** + +Deprecated: setlocale(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d +-- Iteration 1 -- + +Deprecated: nl_langinfo(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d + +Warning: nl_langinfo(): Item '0' is not valid in %s on line %d +bool(false) +-- Iteration 2 -- + +Deprecated: nl_langinfo(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d + +Warning: nl_langinfo(): Item '10' is not valid in %s on line %d +bool(false) +-- Iteration 3 -- + +Deprecated: nl_langinfo(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d + +Warning: nl_langinfo(): Item '2147483647' is not valid in %s on line %d +bool(false) +-- Iteration 4 -- + +Deprecated: nl_langinfo(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d + +Warning: nl_langinfo(): Item '-2147483648' is not valid in %s on line %d +bool(false) +-- Iteration 5 -- + +Deprecated: nl_langinfo(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d + +Warning: nl_langinfo(): Item '10' is not valid in %s on line %d +bool(false) +-- Iteration 6 -- + +Deprecated: nl_langinfo(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d + +Warning: nl_langinfo(): Item '20' is not valid in %s on line %d +bool(false) +-- Iteration 7 -- + +Deprecated: nl_langinfo(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d + +Warning: nl_langinfo(): Item '-20' is not valid in %s on line %d +bool(false) +-- Iteration 8 -- + +Deprecated: nl_langinfo(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d + +Warning: nl_langinfo(): Item '1012345' is not valid in %s on line %d +bool(false) +-- Iteration 9 -- + +Warning: nl_langinfo() expects parameter 1 to be long, array given in %s on line %d +NULL +-- Iteration 10 -- + +Warning: nl_langinfo() expects parameter 1 to be long, array given in %s on line %d +NULL +-- Iteration 11 -- + +Warning: nl_langinfo() expects parameter 1 to be long, array given in %s on line %d +NULL +-- Iteration 12 -- + +Deprecated: nl_langinfo(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d + +Warning: nl_langinfo(): Item '1' is not valid in %s on line %d +bool(false) +-- Iteration 13 -- + +Deprecated: nl_langinfo(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d + +Warning: nl_langinfo(): Item '0' is not valid in %s on line %d +bool(false) +-- Iteration 14 -- + +Deprecated: nl_langinfo(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d + +Warning: nl_langinfo(): Item '1' is not valid in %s on line %d +bool(false) +-- Iteration 15 -- + +Deprecated: nl_langinfo(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d + +Warning: nl_langinfo(): Item '0' is not valid in %s on line %d +bool(false) +-- Iteration 16 -- + +Deprecated: nl_langinfo(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d + +Warning: nl_langinfo(): Item '0' is not valid in %s on line %d +bool(false) +-- Iteration 17 -- + +Deprecated: nl_langinfo(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d + +Warning: nl_langinfo(): Item '0' is not valid in %s on line %d +bool(false) +-- Iteration 18 -- + +Warning: nl_langinfo() expects parameter 1 to be long, object given in %s on line %d +NULL +-- Iteration 19 -- + +Warning: nl_langinfo() expects parameter 1 to be long, resource given in %s on line %d +NULL +-- Iteration 20 -- + +Deprecated: nl_langinfo(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d + +Warning: nl_langinfo(): Item '0' is not valid in %s on line %d +bool(false) +-- Iteration 21 -- + +Deprecated: nl_langinfo(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d + +Warning: nl_langinfo(): Item '0' is not valid in %s on line %d +bool(false) + +Deprecated: setlocale(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d +===DONE=== diff --git a/ext/standard/tests/strings/number_format_basic.phpt b/ext/standard/tests/strings/number_format_basic.phpt new file mode 100644 index 0000000000..ad0d5f5fae --- /dev/null +++ b/ext/standard/tests/strings/number_format_basic.phpt @@ -0,0 +1,109 @@ +--TEST-- +Test number_format() - basic function test number_format() +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing number_format() : basic functionality *** + + number_format tests.....default +unicode(5) "1,235" +unicode(6) "-1,235" +unicode(10) "12,346,578" +unicode(11) "-12,345,679" +unicode(11) "305,450,479" +unicode(11) "402,653,183" +unicode(11) "123,456,789" +unicode(3) "123" +unicode(3) "123" +unicode(1) "0" +unicode(1) "1" +unicode(1) "0" + + number_format tests.....with two dp +unicode(8) "1,234.57" +unicode(9) "-1,234.57" +unicode(13) "12,346,578.00" +unicode(14) "-12,345,678.90" +unicode(14) "305,450,479.00" +unicode(14) "402,653,183.00" +unicode(14) "123,456,789.00" +unicode(6) "123.46" +unicode(6) "123.46" +unicode(4) "0.00" +unicode(4) "1.00" +unicode(4) "0.00" + + number_format tests.....English format +unicode(8) "1 234.57" +unicode(9) "-1 234.57" +unicode(13) "12 346 578.00" +unicode(14) "-12 345 678.90" +unicode(14) "305 450 479.00" +unicode(14) "402 653 183.00" +unicode(14) "123 456 789.00" +unicode(6) "123.46" +unicode(6) "123.46" +unicode(4) "0.00" +unicode(4) "1.00" +unicode(4) "0.00" + + number_format tests.....French format +unicode(8) "1 234,57" +unicode(9) "-1 234,57" +unicode(13) "12 346 578,00" +unicode(14) "-12 345 678,90" +unicode(14) "305 450 479,00" +unicode(14) "402 653 183,00" +unicode(14) "123 456 789,00" +unicode(6) "123,46" +unicode(6) "123,46" +unicode(4) "0,00" +unicode(4) "1,00" +unicode(4) "0,00" +===DONE=== diff --git a/ext/standard/tests/strings/number_format_error.phpt b/ext/standard/tests/strings/number_format_error.phpt new file mode 100644 index 0000000000..89fbc16fa2 --- /dev/null +++ b/ext/standard/tests/strings/number_format_error.phpt @@ -0,0 +1,31 @@ +--TEST-- +Test number_format() - wrong params test number_format() +--FILE-- + +===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 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_basic.phpt b/ext/standard/tests/strings/ord_basic.phpt new file mode 100644 index 0000000000..19f3ea28d6 --- /dev/null +++ b/ext/standard/tests/strings/ord_basic.phpt @@ -0,0 +1,47 @@ +--TEST-- +Test ord() function : basic functionality +--FILE-- + +===DONE=== +--EXPECT-- +*** Testing ord() : basic functionality *** +int(97) +int(122) +int(48) +int(57) +int(33) +int(42) +int(64) +int(10) +int(10) +int(255) +int(72) +===DONE=== diff --git a/ext/standard/tests/strings/ord_error.phpt b/ext/standard/tests/strings/ord_error.phpt new file mode 100644 index 0000000000..455fb38972 --- /dev/null +++ b/ext/standard/tests/strings/ord_error.phpt @@ -0,0 +1,34 @@ +--TEST-- +Test ord() function : error conditions +--FILE-- + +===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/ord_variation1.phpt b/ext/standard/tests/strings/ord_variation1.phpt new file mode 100644 index 0000000000..7c8448aec6 --- /dev/null +++ b/ext/standard/tests/strings/ord_variation1.phpt @@ -0,0 +1,137 @@ +--TEST-- +Test ord() function : usage variations - test values for $string argument +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing ord() function: with unexpected inputs for 'string' argument *** +-- Iteration 1 -- +int(48) +-- Iteration 2 -- +int(49) +-- Iteration 3 -- +int(50) +-- Iteration 4 -- +int(50) +-- Iteration 5 -- +int(50) +-- Iteration 6 -- +int(45) +-- Iteration 7 -- +int(49) +-- Iteration 8 -- +int(45) +-- Iteration 9 -- +int(49) +-- Iteration 10 -- + +Warning: ord() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 11 -- + +Warning: ord() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 12 -- + +Warning: ord() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 13 -- +int(49) +-- Iteration 14 -- +int(0) +-- Iteration 15 -- +int(49) +-- Iteration 16 -- +int(0) +-- Iteration 17 -- +int(0) +-- Iteration 18 -- +int(0) +-- Iteration 19 -- +int(115) +-- Iteration 20 -- + +Warning: ord() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d +NULL +-- Iteration 21 -- +int(0) +-- Iteration 22 -- +int(0) +===DONE===