diff options
Diffstat (limited to 'tests/strings/001.phpt')
-rw-r--r-- | tests/strings/001.phpt | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/strings/001.phpt b/tests/strings/001.phpt index 3bfd3dbc30..98ceceb350 100644 --- a/tests/strings/001.phpt +++ b/tests/strings/001.phpt @@ -177,9 +177,23 @@ if ($ss == "\$'") { } -echo "Testing uniqid: "; +echo "Testing uniqid(true): "; +$str = "prefix"; +$ui1 = uniqid($str, true); +$ui2 = uniqid($str, true); + +$len = 29; + +if (strlen($ui1) == strlen($ui2) && strlen($ui1) == $len && $ui1 != $ui2) { + echo("passed\n"); +} else { + echo("failed!\n"); +} + +echo "Testing uniqid(false): "; $str = "prefix"; $ui1 = uniqid($str); +usleep( 1 ); $ui2 = uniqid($str); $len = strncasecmp(PHP_OS, 'CYGWIN', 6) ? 19 : 29; @@ -207,4 +221,5 @@ Testing ufirst: passed Testing strtr: passed Testing addslashes: passed Testing stripslashes: passed -Testing uniqid: passed +Testing uniqid(true): passed +Testing uniqid(false): passed |