Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b59664b

Browse files
feature #18726 [PhpUnitBridge] Make ClockMock match namespaces that begin with Tests\\ (teohhanhui)
This PR was submitted for the 2.8 branch but it was merged into the 3.2-dev branch instead (closes #18726). Discussion ---------- [PhpUnitBridge] Make ClockMock match namespaces that begin with Tests\\ | Q | A | ------------- | --- | Branch? | 2.8 | 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 See symfony/symfony-standard#969 Commits ------- 2630c13 [PhpUnitBridge] Make ClockMock match namespaces that begin with Tests\\
2 parents f0953da + 2630c13 commit b59664b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Symfony/Bridge/PhpUnit/ClockMock.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ public static function register($class)
7777
if (0 < strpos($class, '\\Tests\\')) {
7878
$ns = str_replace('\\Tests\\', '\\', $class);
7979
$mockedNs[] = substr($ns, 0, strrpos($ns, '\\'));
80+
} elseif (0 === strpos($class, 'Tests\\')) {
81+
$mockedNs[] = substr($class, 6, strrpos($class, '\\') - 6);
8082
}
8183
foreach ($mockedNs as $ns) {
8284
if (function_exists($ns.'\time')) {

0 commit comments

Comments
 (0)