Skip to content

Commit 694ae36

Browse files
committed
add test
1 parent e9fe9b0 commit 694ae36

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
--TEST--
2+
Multicast error
3+
--EXTENSIONS--
4+
sockets
5+
--FILE--
6+
<?php
7+
include __DIR__."/mcast_helpers.php.inc";
8+
$domain = AF_INET;
9+
$level = IPPROTO_IP;
10+
$interface = "lo";
11+
$mcastaddr = '224.0.0.23';
12+
$sblock = "127.0.0.1";
13+
14+
$s = socket_create($domain, SOCK_DGRAM, SOL_UDP);
15+
$b = socket_bind($s, '0.0.0.0', 0);
16+
$iwanttoleavenow = true;
17+
18+
try {
19+
socket_set_option($s, $level, MCAST_LEAVE_GROUP, $iwanttoleavenow);
20+
} catch (\TypeError $e) {
21+
echo $e->getMessage(), PHP_EOL;
22+
}
23+
24+
try {
25+
socket_set_option($s, $level, MCAST_LEAVE_SOURCE_GROUP, $iwanttoleavenow);
26+
} catch (\TypeError $e) {
27+
echo $e->getMessage();
28+
}
29+
?>
30+
--EXPECT--
31+
must be of type array when argument #3 ($option) is MCAST_LEAVE_GROUP, true given
32+
must be of type array when argument #3 ($option) is MCAST_LEAVE_SOURCE_GROUP, true given

0 commit comments

Comments
 (0)