diff options
Diffstat (limited to 'ext/standard/tests/array/array_rand_variation5.phpt')
| -rw-r--r-- | ext/standard/tests/array/array_rand_variation5.phpt | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/ext/standard/tests/array/array_rand_variation5.phpt b/ext/standard/tests/array/array_rand_variation5.phpt index 03e20d6e07..04e71bdc49 100644 --- a/ext/standard/tests/array/array_rand_variation5.phpt +++ b/ext/standard/tests/array/array_rand_variation5.phpt @@ -34,34 +34,32 @@ var_dump( array_rand($input, 1) ); // with valid $num_req value echo"\n-- With num_req = 0 --\n"; try { var_dump( array_rand($input, 0) ); // with $num_req=0 -} catch (\Error $e) { +} catch (\ValueError $e) { echo $e->getMessage() . "\n"; } echo"\n-- With num_req = -1 --\n"; try { var_dump( array_rand($input, -1) ); // with $num_req=-1 -} catch (\Error $e) { +} catch (\ValueError $e) { echo $e->getMessage() . "\n"; } echo"\n-- With num_req = -2 --\n"; try { var_dump( array_rand($input, -2) ); // with $num_req=-2 -} catch (\Error $e) { +} catch (\ValueError $e) { echo $e->getMessage() . "\n"; } echo"\n-- With num_req more than number of members in 'input' array --\n"; try { var_dump( array_rand($input, 13) ); // with $num_req=13 -} catch (\Error $e) { +} catch (\ValueError $e) { echo $e->getMessage() . "\n"; } ?> - -DONE --EXPECTF-- *** Testing array_rand() : with invalid values for 'req_num' *** @@ -82,5 +80,3 @@ Second argument has to be between 1 and the number of elements in the array -- With num_req more than number of members in 'input' array -- Second argument has to be between 1 and the number of elements in the array - -DONE |
