diff options
author | Matthias Karbe <karbe@celloon.de> | 2020-09-23 14:25:30 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-09-29 10:57:20 +0200 |
commit | 28991373917da1964d457994245eb0a7c83ca19e (patch) | |
tree | b75aa134a0851a55ab4f3981471e1776e2a6a22a | |
parent | 035ad0aed57671a071c1d85ad803f7b030925165 (diff) | |
download | php-git-28991373917da1964d457994245eb0a7c83ca19e.tar.gz |
Fix bug #80138
Skip getservbyname() and getservbyport() tests on *nix if there is
no /etc/services file.
Closes GH-6191.
3 files changed, 18 insertions, 0 deletions
diff --git a/ext/standard/tests/general_functions/getservbyname_basic.phpt b/ext/standard/tests/general_functions/getservbyname_basic.phpt index adaa7afb43..42504fc497 100644 --- a/ext/standard/tests/general_functions/getservbyname_basic.phpt +++ b/ext/standard/tests/general_functions/getservbyname_basic.phpt @@ -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 diff --git a/ext/standard/tests/general_functions/getservbyport_basic.phpt b/ext/standard/tests/general_functions/getservbyport_basic.phpt index b9e0f83c98..0b3ab85a5d 100644 --- a/ext/standard/tests/general_functions/getservbyport_basic.phpt +++ b/ext/standard/tests/general_functions/getservbyport_basic.phpt @@ -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")) { diff --git a/ext/standard/tests/general_functions/getservbyport_variation1.phpt b/ext/standard/tests/general_functions/getservbyport_variation1.phpt index a876ac1fea..5193027d43 100644 --- a/ext/standard/tests/general_functions/getservbyport_variation1.phpt +++ b/ext/standard/tests/general_functions/getservbyport_variation1.phpt @@ -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" )); |