Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/phpunit-bridge/ClockMock.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 1fec387a4317 |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
64 | 64 |
65 if ($asFloat) { | 65 if ($asFloat) { |
66 return self::$now; | 66 return self::$now; |
67 } | 67 } |
68 | 68 |
69 return sprintf('%0.6f %d', self::$now - (int) self::$now, (int) self::$now); | 69 return sprintf('%0.6f00 %d', self::$now - (int) self::$now, (int) self::$now); |
70 } | 70 } |
71 | 71 |
72 public static function register($class) | 72 public static function register($class) |
73 { | 73 { |
74 $self = get_called_class(); | 74 $self = \get_called_class(); |
75 | 75 |
76 $mockedNs = array(substr($class, 0, strrpos($class, '\\'))); | 76 $mockedNs = array(substr($class, 0, strrpos($class, '\\'))); |
77 if (0 < strpos($class, '\\Tests\\')) { | 77 if (0 < strpos($class, '\\Tests\\')) { |
78 $ns = str_replace('\\Tests\\', '\\', $class); | 78 $ns = str_replace('\\Tests\\', '\\', $class); |
79 $mockedNs[] = substr($ns, 0, strrpos($ns, '\\')); | 79 $mockedNs[] = substr($ns, 0, strrpos($ns, '\\')); |
80 } elseif (0 === strpos($class, 'Tests\\')) { | 80 } elseif (0 === strpos($class, 'Tests\\')) { |
81 $mockedNs[] = substr($class, 6, strrpos($class, '\\') - 6); | 81 $mockedNs[] = substr($class, 6, strrpos($class, '\\') - 6); |
82 } | 82 } |
83 foreach ($mockedNs as $ns) { | 83 foreach ($mockedNs as $ns) { |
84 if (function_exists($ns.'\time')) { | 84 if (\function_exists($ns.'\time')) { |
85 continue; | 85 continue; |
86 } | 86 } |
87 eval(<<<EOPHP | 87 eval(<<<EOPHP |
88 namespace $ns; | 88 namespace $ns; |
89 | 89 |