W3cubDocs

/Symfony 4.1

DnsMock

class DnsMock

Methods

static withMockedHosts(array $hosts)

Configures the mock values for DNS queries.

static checkdnsrr($hostname, $type = 'MX')
static getmxrr($hostname, $mxhosts, $weight = null)
static gethostbyaddr($ipAddress)
static gethostbyname($hostname)
static gethostbynamel($hostname)
static dns_get_record($hostname, $type = DNS_ANY, $authns = null, $addtl = null, $raw = false)
static register($class)

Details

static withMockedHosts(array $hosts)

Configures the mock values for DNS queries.

Parameters

array $hosts Mocked hosts as keys, arrays of DNS records as returned by dns_get_record() as values

static checkdnsrr($hostname, $type = 'MX')

Parameters

$hostname
$type

static getmxrr($hostname, $mxhosts, $weight = null)

Parameters

$hostname
$mxhosts
$weight

static gethostbyaddr($ipAddress)

Parameters

$ipAddress

static gethostbyname($hostname)

Parameters

$hostname

static gethostbynamel($hostname)

Parameters

$hostname

static dns_get_record($hostname, $type = DNS_ANY, $authns = null, $addtl = null, $raw = false)

Parameters

$hostname
$type
$authns
$addtl
$raw

static register($class)

Parameters

$class

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Bridge/PhpUnit/DnsMock.html