mirror of
https://github.com/php/php-src.git
synced 2026-04-14 11:32:11 +02:00
Skip getprotobyname() and getprotobynumber() tests on *nix if there is no /etc/protocols file. Closes GH-6193.
17 lines
351 B
PHP
17 lines
351 B
PHP
--TEST--
|
|
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'));
|
|
?>
|
|
--EXPECT--
|
|
int(6)
|