Skip to content

Commit 313c8c0

Browse files
feature symfony#18964 [PhpUnitBridge] Make DnsMock match namespaces that begin with Tests\\ (teohhanhui)
This PR was merged into the 3.2-dev branch. Discussion ---------- [PhpUnitBridge] Make DnsMock match namespaces that begin with Tests\\ | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes? | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | N/A | License | MIT | Doc PR | symfony/symfony-docs#6546 Related to symfony/symfony-standard#969 Commits ------- d043305 [PhpUnitBridge] Make DnsMock match namespaces that begin with Tests\\
2 parents b59664b + d043305 commit 313c8c0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Symfony/Bridge/PhpUnit/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)