[PhpUnitBridge] Make ClockMock match namespaces that begin with Tests\\

This commit is contained in:
Teoh Han Hui 2016-05-09 14:15:43 +08:00 committed by Nicolas Grekas
parent f0953dab1d
commit 2630c13671

View File

@ -77,6 +77,8 @@ class ClockMock
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.'\time')) {