feature #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\\
This commit is contained in:
Nicolas Grekas 2016-06-03 12:59:16 +02:00
commit 313c8c03de

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')) {