mirror of
https://github.com/php/php-src.git
synced 2026-04-01 05:02:27 +02:00
Merge branch 'pull-request/1808'
This commit is contained in:
29
ext/standard/tests/network/dns_get_mx.phpt
Normal file
29
ext/standard/tests/network/dns_get_mx.phpt
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user