summaryrefslogtreecommitdiff
path: root/ext/standard/tests/network/getmxrr.phpt
blob: 1a005dfdd99ad3ceab9a64499e421aff048810f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--TEST--
getmxrr() test
--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(
    'mx1.tests.php.net.',
    'mx2.tests.php.net.',
    'qa.php.net.',
);
foreach ($domains as $domain) {
    $result = getmxrr($domain, $hosts, $weights);
    echo "Result: " . ($result ? "true" : "false")
       . ", hosts: " . count( $hosts )
       . ", weights: " . count( $weights ) . "\n";
}
?>
--EXPECT--
Result: true, hosts: 1, weights: 1
Result: true, hosts: 2, weights: 2
Result: false, hosts: 0, weights: 0