com php-src: test to function dns_get_mx();: ext/ standard/tests/network/dns_get_mx.phpt

From: Date: Sun, 13 Mar 2016 04:55:27 +0000
Subject: com php-src: test to function dns_get_mx();: ext/ standard/tests/network/dns_get_mx.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-95153@lists.php.net to get a copy of this message
Commit: 651f3cf23add3fb12b4839ba897dd741dccdae3a Author: marcosptf <marcosptf@yahoo.com.br> Sun, 13 Mar 2016 01:55:27 -0300 Parents: 01579ae0a6eda82b72a8d44d5cbdeef50a21ca79 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=651f3cf23add3fb12b4839ba897dd741dccdae3a Log: test to function dns_get_mx(); was added a new function to standard module a network function dns_get_mx(); 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 (#95153) next »