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.4.0alpha1~191^2~2794 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aea600260b008b1c5e04fd35babf5a8392293ad1;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..fda95de2bb --- /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 +unicode(13) "%s" +unicode(23) "%s.%s" +unicode(13) "%s" + + +uniqid() with a prefix +unicode(18) "99999%s" +unicode(28) "99999%s.%s" +unicode(18) "99999%s" + +unicode(18) "999994%s" +unicode(28) "999994%s.%s" +unicode(18) "999994%s" + +unicode(17) "1050%s" +unicode(27) "1050%s.%s" +unicode(17) "1050%s" + +unicode(13) "%s" +unicode(23) "%s.%s" +unicode(13) "%s" + +unicode(14) "1%s" +unicode(24) "1%s.%s" +unicode(14) "1%s" + +unicode(13) "%s" +unicode(23) "%s.%s" +unicode(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..ce4e329c3f --- /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 (Unicode or binary), array given in %s on line %d + +Warning: uniqid() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d + +Warning: uniqid() expects parameter 1 to be string (Unicode or binary), object given in %s on line %d +===DONE=== \ No newline at end of file