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

Closes GH-6191.

ext/standard/tests/general_functions/getservbyname_basic.phpt
ext/standard/tests/general_functions/getservbyport_basic.phpt
ext/standard/tests/general_functions/getservbyport_variation1.phpt

index adaa7afb43999f72550f3e3cf8a702d114ed7ebc..42504fc497037c312849fd12d7b1177d895b0eba 100644 (file)
@@ -5,6 +5,12 @@ Italian PHP TestFest 2009 Cesena 19-20-21 june
 Fabio Fabbrucci (fabbrucci@grupporetina.com)
 Michele Orselli (mo@ideato.it)
 Simone Gentili (sensorario@gmail.com)
+--SKIPIF--
+<?php
+    if(in_array(PHP_OS_FAMILY, ['BSD', 'Darwin', 'Solaris', 'Linux'])){
+        if (!file_exists("/etc/services")) die("skip reason: missing /etc/services");
+    }
+?>
 --FILE--
 <?php
 
index b9e0f83c987377a0701c7bc9ea73b747260210a5..0b3ab85a5dc6b1be612d0584a368de89cb06216b 100644 (file)
@@ -5,6 +5,12 @@ Italian PHP TestFest 2009 Cesena 19-20-21 june
 Fabio Fabbrucci (fabbrucci@grupporetina.com)
 Michele Orselli (mo@ideato.it)
 Simone Gentili (sensorario@gmail.com)
+--SKIPIF--
+<?php
+    if(in_array(PHP_OS_FAMILY, ['BSD', 'Darwin', 'Solaris', 'Linux'])){
+        if (!file_exists("/etc/services")) die("skip reason: missing /etc/services");
+    }
+?>
 --FILE--
 <?php
        if (file_exists("/etc/services")) {
index a876ac1fea7ce2e4cdf6405038b770ede4d04175..5193027d438155d8dae476d3a119e7f58aeec4ce 100644 (file)
@@ -7,6 +7,12 @@ Italian PHP TestFest 2009 Cesena 19-20-21 june
 Fabio Fabbrucci (fabbrucci@grupporetina.com)
 Michele Orselli (mo@ideato.it)
 Simone Gentili (sensorario@gmail.com)
+--SKIPIF--
+<?php
+    if(in_array(PHP_OS_FAMILY, ['BSD', 'Darwin', 'Solaris', 'Linux'])){
+        if (!file_exists("/etc/services")) die("skip reason: missing /etc/services");
+    }
+?>
 --FILE--
 <?php
        var_dump(getservbyport( -1, "tcp" ));