1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 23:18:13 +02:00
Files
archived-php-src/ext/standard/tests/network/bug73594.phpt
T
Máté Kocsis fbe30592d6 Improve type error messages when an object is given
From now on, we always display the given object's type instead of just reporting "object".
Additionally, make the format of return type errors match the format of argument errors.

Closes GH-5625
2020-05-26 19:06:19 +02:00

28 lines
752 B
PHP

--TEST--
Bug #73594 (dns_get_record() does not populate $additional out parameter)
--SKIPIF--
<?php
if (getenv("SKIP_ONLINE_TESTS")) die("skip test requiring internet connection");
$out = array();
$ret = 0;
exec("dig -tmx php.net +noall +additional 2>/dev/null", $out, $ret);
if ($ret != 0) die("skip dig command is not present or failed to run");
// skip empty and header lines
$out = preg_grep("/^(?!($|;))/", $out);
if (empty($out)) die("skip local resolver does not return additional records");
?>
--FILE--
<?php
$auth = array();
$additional = array();
$res = dns_get_record('php.net', DNS_MX, $auth, $additional);
// only check $additional if dns_get_record is successful
var_dump(!empty($res) && empty($additional));
?>
--EXPECT--
bool(true)