8000 [PhpUnitBridge] Make ClockMock match namespaces that begin with Tests\\ · symfony/symfony@310eaa5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 310eaa5

Browse files
committed
[PhpUnitBridge] Make ClockMock match namespaces that begin with Tests\\
1 parent 8ca614d commit 310eaa5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Symfony/Bridge/PhpUnit/ClockMock.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,11 @@ public static function register($class)
7474
$self = get_called_class();
7575

7676
$mockedNs = array(substr($class, 0, strrpos($class, '\\')));
77-
if (strpos($class, '\\Tests\\')) {
77+
if (false !== 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, '\\'));
8082
}
8183
foreach ($mockedNs as $ns) {
8284
if (function_exists($ns.'\time')) {

0 commit comments

Comments
 (0)
0