Skip to content

Commit 5342898

Browse files
committed
add tests
1 parent 64f6042 commit 5342898

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

ext/sockets/tests/gh20532.phpt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--TEST--
2+
GH-20562 - socket_addrinfo_lookup() returns error codes on resolution failures.
3+
--EXTENSIONS--
4+
sockets
5+
--FILE--
6+
<?php
7+
var_dump(socket_addrinfo_lookup(".whynot") == EAI_NONAME);
8+
var_dump(in_array(socket_addrinfo_lookup("example.com", "http", ['ai_socktype' => SOCK_RAW]), [EAI_SOCKTYPE, EAI_SERVICE]));
9+
var_dump(in_array(socket_addrinfo_lookup("example.com", "http", ['ai_socktype' => SOCK_RDM, 'ai_family' => AF_INET6]), [EAI_FAMILY, EAI_SOCKTYPE]));
10+
?>
11+
--EXPECT--
12+
bool(true)
13+
bool(true)
14+
bool(true)
15+

0 commit comments

Comments
 (0)