Skip to content

Fix #80137: skip getprotobyname() and getprotobynumber() tests on *nix if there is no /etc/protocols file #6193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

makadev
Copy link
Contributor

@makadev makadev commented Sep 23, 2020

Fix proposal for https://bugs.php.net/bug.php?id=80137

Skip failing tests on *nix if there is no /etc/protocols file.

@@ -2,6 +2,12 @@
getprotobyname function basic test
--CREDITS--
edgarsandi - <[email protected]>
--SKIPIF--
<?php
if(in_array(PHP_OS_FAMILY, ['BSD', 'Darwin', 'Solaris', 'Linux'])){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldn't you just do the feature detect without this OS whitelist?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added the OS whitelist to prevent the test from being skipped on Windows and others (PHP_OS_FAMILY=Unknown). As far as I know only *nix has the /etc/protocols file which is read by C getprotobyname / getprotobynumber.

@php-pulls php-pulls closed this in f5afd0a Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants