Skip to content

Commit f5afd0a

Browse files
makadevnikic
authored andcommitted
Fix bug #80137
Skip getprotobyname() and getprotobynumber() tests on *nix if there is no /etc/protocols file. Closes GH-6193.
1 parent 2899137 commit f5afd0a

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

ext/standard/tests/network/getprotobyname_basic.phpt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
getprotobyname function basic test
33
--CREDITS--
44
edgarsandi - <edgar.r.sandi@gmail.com>
5+
--SKIPIF--
6+
<?php
7+
if(in_array(PHP_OS_FAMILY, ['BSD', 'Darwin', 'Solaris', 'Linux'])){
8+
if (!file_exists("/etc/protocols")) die("skip reason: missing /etc/protocols");
9+
}
10+
?>
511
--FILE--
612
<?php
713
var_dump(getprotobyname('tcp'));

ext/standard/tests/network/getprotobynumber_basic.phpt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
getprotobynumber function basic test
33
--CREDITS--
44
edgarsandi - <edgar.r.sandi@gmail.com>
5+
--SKIPIF--
6+
<?php
7+
if(in_array(PHP_OS_FAMILY, ['BSD', 'Darwin', 'Solaris', 'Linux'])){
8+
if (!file_exists("/etc/protocols")) die("skip reason: missing /etc/protocols");
9+
}
10+
?>
511
--FILE--
612
<?php
713
var_dump(getprotobynumber(6));

0 commit comments

Comments
 (0)