Skip to content

Commit c2d6450

Browse files
committed
[PhpUnitBridge] Make DnsMock match namespaces that begin with Tests\\
1 parent ae85527 commit c2d6450

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

DnsMock.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ public static function register($class)
169169
if (0 < strpos($class, '\\Tests\\')) {
170170
$ns = str_replace('\\Tests\\', '\\', $class);
171171
$mockedNs[] = substr($ns, 0, strrpos($ns, '\\'));
172+
} elseif (0 === strpos($class, 'Tests\\')) {
173+
$mockedNs[] = substr($class, 6, strrpos($class, '\\') - 6);
172174
}
173175
foreach ($mockedNs as $ns) {
174176
if (function_exists($ns.'\checkdnsrr')) {

0 commit comments

Comments
 (0)