Documentation

DnsMock
in package

Tags
author

Nicolas Grekas p@tchwork.com

Table of Contents

Properties

$dnsTypes  : mixed
$hosts  : mixed

Methods

checkdnsrr()  : bool
dns_get_record()  : mixed
gethostbyaddr()  : mixed
gethostbyname()  : mixed
gethostbynamel()  : mixed
getmxrr()  : bool
register()  : void
withMockedHosts()  : void
Configures the mock values for DNS queries.

Properties

$dnsTypes

private static mixed $dnsTypes = ['A' => \DNS_A, 'MX' => \DNS_MX, 'NS' => \DNS_NS, 'SOA' => \DNS_SOA, 'PTR' => \DNS_PTR, 'CNAME' => \DNS_CNAME, 'AAAA' => \DNS_AAAA, 'A6' => \DNS_A6, 'SRV' => \DNS_SRV, 'NAPTR' => \DNS_NAPTR, 'TXT' => \DNS_TXT, 'HINFO' => \DNS_HINFO]

$hosts

private static mixed $hosts = []

Methods

checkdnsrr()

public static checkdnsrr(mixed $hostname[, mixed $type = 'MX' ]) : bool
Parameters
$hostname : mixed
$type : mixed = 'MX'
Return values
bool

dns_get_record()

public static dns_get_record(mixed $hostname[, mixed $type = DNS_ANY ][, mixed &$authns = null ][, mixed &$addtl = null ][, mixed $raw = false ]) : mixed
Parameters
$hostname : mixed
$type : mixed = DNS_ANY
$authns : mixed = null
$addtl : mixed = null
$raw : mixed = false

gethostbyaddr()

public static gethostbyaddr(mixed $ipAddress) : mixed
Parameters
$ipAddress : mixed

gethostbyname()

public static gethostbyname(mixed $hostname) : mixed
Parameters
$hostname : mixed

gethostbynamel()

public static gethostbynamel(mixed $hostname) : mixed
Parameters
$hostname : mixed

getmxrr()

public static getmxrr(mixed $hostname, mixed &$mxhosts[, mixed &$weight = null ]) : bool
Parameters
$hostname : mixed
$mxhosts : mixed
$weight : mixed = null
Return values
bool

register()

public static register(mixed $class) : void
Parameters
$class : mixed

withMockedHosts()

Configures the mock values for DNS queries.

public static withMockedHosts(array<string|int, mixed> $hosts) : void
Parameters
$hosts : array<string|int, mixed>

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


        
On this page

Search results