[PhpUnitBridge] Make DnsMock match namespaces that begin with Tests\\

This commit is contained in:
Teoh Han Hui 2016-06-03 17:32:43 +08:00
parent b59664bc42
commit d0433054b9
No known key found for this signature in database
GPG Key ID: 729783C96A30C9B8

View File

@ -169,6 +169,8 @@ class DnsMock
if (0 < strpos($class, '\\Tests\\')) {
$ns = str_replace('\\Tests\\', '\\', $class);
$mockedNs[] = substr($ns, 0, strrpos($ns, '\\'));
} elseif (0 === strpos($class, 'Tests\\')) {
$mockedNs[] = substr($class, 6, strrpos($class, '\\') - 6);
}
foreach ($mockedNs as $ns) {
if (function_exists($ns.'\checkdnsrr')) {