com php-src: Merge branch 'pull-request/1808': ext/standard/tes ts/network/dns_get_mx.phpt

From: Date: Mon, 17 Oct 2016 16:02:07 +0000
Subject: com php-src: Merge branch 'pull-request/1808': ext/standard/tes ts/network/dns_get_mx.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-95163@lists.php.net to get a copy of this message
Commit: b274be5d9d34153663fb45cde401d5b37748cfdc Author: Joe Watkins <krakjoe@php.net> Mon, 17 Oct 2016 16:53:04 +0100 Parents: 63166412a2d22ddb58ef40a9dd5872d9ac0369be Branches: PHP-7.1 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b274be5d9d34153663fb45cde401d5b37748cfdc Log: Merge branch 'pull-request/1808' Changed paths: A ext/standard/tests/network/dns_get_mx.phpt Diff: diff --git a/ext/standard/tests/network/dns_get_mx.phpt b/ext/standard/tests/network/dns_get_mx.phpt new file mode 100644 index 0000000..c5bf361 --- /dev/null +++ b/ext/standard/tests/network/dns_get_mx.phpt @@ -0,0 +1,29 @@ +--TEST-- +bool dns_get_mx ( string $hostname , array &$mxhosts [, array &$weight ] ); +--CREDITS-- +marcosptf - <marcosptf@yahoo.com.br> - @phpsp - sao paulo - br +--SKIPIF-- +<?php +if (getenv("SKIP_SLOW_TESTS")) + die("skip slow test"); +if (getenv("SKIP_ONLINE_TESTS")) + die("skip test requiring internet connection"); +if (substr(PHP_OS, 0, 3) == 'WIN') { + die('skip: no Windows support'); +} +?> +--FILE-- +<?php +$domains = array('yahoo.co.jp', 'yahoo.com', 'es.yahoo.com', 'fr.yahoo.com', 'it.yahoo.com'); +foreach ($domains as $domain) { + if (getmxrr($domain, $hosts, $weights)) { + echo "Hosts: " . count($hosts) . ", weights: " . count($weights) . "\n"; + } +} +?> +--EXPECTF-- +Hosts: %i, weights: %i +Hosts: %i, weights: %i +Hosts: %i, weights: %i +Hosts: %i, weights: %i +Hosts: %i, weights: %i

« previous php.cvs (#95163) next »