diff options
Diffstat (limited to 'ext/sockets/tests/socket_sendto_params.phpt')
| -rw-r--r-- | ext/sockets/tests/socket_sendto_params.phpt | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/sockets/tests/socket_sendto_params.phpt b/ext/sockets/tests/socket_sendto_params.phpt index e4808a93ee..09cb859ad7 100644 --- a/ext/sockets/tests/socket_sendto_params.phpt +++ b/ext/sockets/tests/socket_sendto_params.phpt @@ -9,8 +9,12 @@ ext/sockets - socket_sendto - test with incorrect parameters --FILE-- <?php $s_c = socket_create_listen(0); - $s_w = socket_sendto($s_c, "foo", -1, MSG_OOB, '127.0.0.1'); + try { + $s_w = socket_sendto($s_c, "foo", -1, MSG_OOB, '127.0.0.1'); + } catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; + } socket_close($s_c); ?> ---EXPECTF-- -Warning: socket_sendto(): Length cannot be negative in %s on line %i +--EXPECT-- +socket_sendto(): Argument #3 ($len) must be greater than or equal to 0 |
