]> granicus.if.org Git - php/commitdiff
Fix bug #80137
authorMatthias Karbe <karbe@celloon.de>
Wed, 23 Sep 2020 12:54:25 +0000 (14:54 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 29 Sep 2020 08:58:00 +0000 (10:58 +0200)
Skip getprotobyname() and getprotobynumber() tests on *nix if there
is no /etc/protocols file.

Closes GH-6193.

ext/standard/tests/network/getprotobyname_basic.phpt
ext/standard/tests/network/getprotobynumber_basic.phpt

index 37cc26aa2b1654c190637d92ba4bd49a0ad37397..76ce3a6e99dd4d1782cdedf26f273b5368e315f1 100644 (file)
@@ -2,6 +2,12 @@
 getprotobyname function basic test
 --CREDITS--
 edgarsandi - <edgar.r.sandi@gmail.com>
+--SKIPIF--
+<?php
+    if(in_array(PHP_OS_FAMILY, ['BSD', 'Darwin', 'Solaris', 'Linux'])){
+        if (!file_exists("/etc/protocols")) die("skip reason: missing /etc/protocols");
+    }
+?>
 --FILE--
 <?php
        var_dump(getprotobyname('tcp'));
index 7850e60ffd90c6a644b66b8bde63fe91a0ed3b68..e8245bd911b7adbddaf8953e6626b5f6a0c6982f 100644 (file)
@@ -2,6 +2,12 @@
 getprotobynumber function basic test
 --CREDITS--
 edgarsandi - <edgar.r.sandi@gmail.com>
+--SKIPIF--
+<?php
+    if(in_array(PHP_OS_FAMILY, ['BSD', 'Darwin', 'Solaris', 'Linux'])){
+        if (!file_exists("/etc/protocols")) die("skip reason: missing /etc/protocols");
+    }
+?>
 --FILE--
 <?php
        var_dump(getprotobynumber(6));