bug #33675 [PhpUnit] Fix usleep mock return value (fabpot)
This PR was merged into the 3.4 branch.
Discussion
----------
[PhpUnit] Fix usleep mock return value
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | n/a| License | MIT
| Doc PR | n/a
`usleep` does not return anything.
Commits
-------
8198d93c5b
[PhpUnit] Fix usleep mock return value
This commit is contained in:
commit
7c04a82a47
@ -52,12 +52,10 @@ class ClockMock
|
|||||||
public static function usleep($us)
|
public static function usleep($us)
|
||||||
{
|
{
|
||||||
if (null === self::$now) {
|
if (null === self::$now) {
|
||||||
return \usleep($us);
|
\usleep($us);
|
||||||
|
} else {
|
||||||
|
self::$now += $us / 1000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
self::$now += $us / 1000000;
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function microtime($asFloat = false)
|
public static function microtime($asFloat = false)
|
||||||
@ -108,7 +106,7 @@ function sleep(\$s)
|
|||||||
|
|
||||||
function usleep(\$us)
|
function usleep(\$us)
|
||||||
{
|
{
|
||||||
return \\$self::usleep(\$us);
|
\\$self::usleep(\$us);
|
||||||
}
|
}
|
||||||
|
|
||||||
EOPHP
|
EOPHP
|
||||||
|
Reference in New Issue
Block a user