summaryrefslogtreecommitdiff
path: root/ext/standard/tests
diff options
context:
space:
mode:
authorJoe Watkins <krakjoe@php.net>2016-10-17 16:53:04 +0100
committerJoe Watkins <krakjoe@php.net>2016-10-17 16:53:04 +0100
commitd6a4e11f9dd07db603adfa7955d4fcc43990272f (patch)
tree9ec201655e616746b75a91750a6ddb5011d65c00 /ext/standard/tests
parent068f6bf9385428d0dc1ceda15d0ae05e01590b67 (diff)
parent651f3cf23add3fb12b4839ba897dd741dccdae3a (diff)
downloadphp-git-d6a4e11f9dd07db603adfa7955d4fcc43990272f.tar.gz
Merge branch 'pull-request/1808'
Diffstat (limited to 'ext/standard/tests')
-rw-r--r--ext/standard/tests/network/dns_get_mx.phpt29
1 files changed, 29 insertions, 0 deletions
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 0000000000..c5bf361b12
--- /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