Class FixedMicrotimeFunction
Mock function for microtime which returns always the same time.
- phpmock\functions\FixedMicrotimeFunction implements phpmock\functions\FunctionProvider, phpmock\functions\Incrementable
Namespace: phpmock\functions
License: WTFPL
Author: Markus Malkusch markus@malkusch.de
Link: Donations
Located at functions/FixedMicrotimeFunction.php
Methods summary
License: WTFPL
Author: Markus Malkusch markus@malkusch.de
Link: Donations
Located at functions/FixedMicrotimeFunction.php
public
#
__construct( mixed $timestamp = null )
Set the timestamp.
Set the timestamp.
Parameters
- $timestamp
- The timestamp, if ommited the current time.
Suppresswarnings(phpmd)
public
callable
#
getCallable( )
Returns this object as a callable for the mock function.
Returns this object as a callable for the mock function.
Returns
callable
The callable for this object.
The callable for this object.
Implementation of
public
#
setMicrotime( string $timestamp )
Set the timestamp as string.
Set the timestamp as string.
Parameters
- $timestamp
- The timestamp as string.
public
#
setMicrotimeAsFloat( float $timestamp )
Set the timestamp as float.
Set the timestamp as float.
Parameters
- $timestamp
- The timestamp as float.
public
mixed
#
getMicrotime( boolean $get_as_float = false )
Returns the microtime.
Returns the microtime.
Parameters
- $get_as_float
- If true returns timestamp as float, else string
Returns
mixed
The value.
The value.