From: andy wharmby Date: Mon, 17 Aug 2009 14:22:02 +0000 (+0000) Subject: New basic tests for uniqid(). Tested on Windows, Linux and Linux 64 bit X-Git-Tag: php-5.2.11RC2~51 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b000227f0adc7874830a133f610436960046192e;p=php New basic tests for uniqid(). Tested on Windows, Linux and Linux 64 bit --- diff --git a/ext/standard/tests/general_functions/uniqid_basic.phpt b/ext/standard/tests/general_functions/uniqid_basic.phpt new file mode 100644 index 0000000000..9a9c573327 --- /dev/null +++ b/ext/standard/tests/general_functions/uniqid_basic.phpt @@ -0,0 +1,73 @@ +--TEST-- +Test uniqid() function : basic functionality +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing uniqid() : basic functionality *** + +uniqid() without a prefix +string(13) "%s" +string(23) "%s.%s" +string(13) "%s" + + +uniqid() with a prefix +string(18) "99999%s" +string(28) "99999%s.%s" +string(18) "99999%s" + +string(18) "999994%s" +string(28) "999994%s.%s" +string(18) "999994%s" + +string(17) "1050%s" +string(27) "1050%s.%s" +string(17) "1050%s" + +string(13) "%s" +string(23) "%s.%s" +string(13) "%s" + +string(14) "1%s" +string(24) "1%s.%s" +string(14) "1%s" + +string(13) "%s" +string(23) "%s.%s" +string(13) "%s" + +===DONE=== + \ No newline at end of file diff --git a/ext/standard/tests/general_functions/uniqid_error.phpt b/ext/standard/tests/general_functions/uniqid_error.phpt new file mode 100644 index 0000000000..96084313c7 --- /dev/null +++ b/ext/standard/tests/general_functions/uniqid_error.phpt @@ -0,0 +1,46 @@ +--TEST-- +Test uniqid() function : error conditions +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing uniqid() : error conditions *** + +-- Testing uniqid() function with more than expected no. of arguments -- + +Warning: uniqid() expects at most 2 parameters, 3 given in %s on line %d +NULL + +-- Testing uniqid() function with invalid values for $prefix -- + +Warning: uniqid() expects parameter 1 to be string, array given in %s on line %d + +Warning: uniqid() expects parameter 1 to be string, resource given in %s on line %d + +Warning: uniqid() expects parameter 1 to be string, object given in %s on line %d +===DONE=== \ No newline at end of file