Skip to content

Commit 56a3ceb

Browse files
committed
ext/sockets: socket_recvfrom() add test for missing port argument error message
1 parent 7ec9420 commit 56a3ceb

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
socket_recvfrom() with IPv4 socket missing port argument
3+
--EXTENSIONS--
4+
sockets
5+
--FILE--
6+
<?php
7+
$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
8+
9+
try {
10+
socket_recvfrom($socket, $buffering, 20, 0, $address);
11+
} catch (Throwable $e) {
12+
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
13+
}
14+
15+
?>
16+
--EXPECT--
17+
ArgumentCountError: Wrong parameter count for socket_recvfrom()
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
socket_recvfrom() with IPv6 socket missing port argument
3+
--EXTENSIONS--
4+
sockets
5+
--SKIPIF--
6+
<?php
7+
require 'ipv6_skipif.inc';
8+
?>
9+
--FILE--
10+
<?php
11+
$socket = socket_create(AF_INET6, SOCK_DGRAM, SOL_UDP);
12+
13+
try {
14+
socket_recvfrom($socket, $buffering, 20, 0, $address);
15+
} catch (Throwable $e) {
16+
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
17+
}
18+
19+
?>
20+
--EXPECT--
21+
ArgumentCountError: Wrong parameter count for socket_recvfrom()

0 commit comments

Comments
 (0)