Skip to content

Commit 2899137

Browse files
makadevnikic
authored andcommitted
Fix bug #80138
Skip getservbyname() and getservbyport() tests on *nix if there is no /etc/services file. Closes GH-6191.
1 parent 035ad0a commit 2899137

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

ext/standard/tests/general_functions/getservbyname_basic.phpt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ Italian PHP TestFest 2009 Cesena 19-20-21 june
55
Fabio Fabbrucci (fabbrucci@grupporetina.com)
66
Michele Orselli (mo@ideato.it)
77
Simone Gentili (sensorario@gmail.com)
8+
--SKIPIF--
9+
<?php
10+
if(in_array(PHP_OS_FAMILY, ['BSD', 'Darwin', 'Solaris', 'Linux'])){
11+
if (!file_exists("/etc/services")) die("skip reason: missing /etc/services");
12+
}
13+
?>
814
--FILE--
915
<?php
1016

ext/standard/tests/general_functions/getservbyport_basic.phpt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ Italian PHP TestFest 2009 Cesena 19-20-21 june
55
Fabio Fabbrucci (fabbrucci@grupporetina.com)
66
Michele Orselli (mo@ideato.it)
77
Simone Gentili (sensorario@gmail.com)
8+
--SKIPIF--
9+
<?php
10+
if(in_array(PHP_OS_FAMILY, ['BSD', 'Darwin', 'Solaris', 'Linux'])){
11+
if (!file_exists("/etc/services")) die("skip reason: missing /etc/services");
12+
}
13+
?>
814
--FILE--
915
<?php
1016
if (file_exists("/etc/services")) {

ext/standard/tests/general_functions/getservbyport_variation1.phpt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ Italian PHP TestFest 2009 Cesena 19-20-21 june
77
Fabio Fabbrucci (fabbrucci@grupporetina.com)
88
Michele Orselli (mo@ideato.it)
99
Simone Gentili (sensorario@gmail.com)
10+
--SKIPIF--
11+
<?php
12+
if(in_array(PHP_OS_FAMILY, ['BSD', 'Darwin', 'Solaris', 'Linux'])){
13+
if (!file_exists("/etc/services")) die("skip reason: missing /etc/services");
14+
}
15+
?>
1016
--FILE--
1117
<?php
1218
var_dump(getservbyport( -1, "tcp" ));

0 commit comments

Comments
 (0)