summaryrefslogtreecommitdiff
path: root/ext/standard/tests/random/random_bytes_error.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/tests/random/random_bytes_error.phpt')
-rw-r--r--ext/standard/tests/random/random_bytes_error.phpt21
1 files changed, 13 insertions, 8 deletions
diff --git a/ext/standard/tests/random/random_bytes_error.phpt b/ext/standard/tests/random/random_bytes_error.phpt
index 466a3ac3bf..c1607c01ff 100644
--- a/ext/standard/tests/random/random_bytes_error.phpt
+++ b/ext/standard/tests/random/random_bytes_error.phpt
@@ -4,14 +4,19 @@ Test error operation of random_bytes()
<?php
//-=-=-=-
-var_dump(random_bytes());
+try {
+ $bytes = random_bytes();
+} catch (TypeError $e) {
+ echo $e->getMessage().PHP_EOL;
+}
-var_dump(random_bytes(-1));
+try {
+ $bytes = random_bytes(0);
+} catch (Error $e) {
+ echo $e->getMessage().PHP_EOL;
+}
?>
---EXPECTF--
-Warning: random_bytes() expects exactly 1 parameter, 0 given in %s on line %d
-NULL
-
-Warning: random_bytes(): Length must be greater than 0 in %s on line %d
-bool(false)
+--EXPECT--
+random_bytes() expects exactly 1 parameter, 0 given
+Length must be greater than 0