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

Skip to content

Commit 2630c13

Browse files
teohhanhuinicolas-grekas
authored andcommitted
[PhpUnitBridge] Make ClockMock match namespaces that begin with Tests\\
1 parent f0953da commit 2630c13

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)