PHP Class phpmock\functions\AbstractSleepFunction

Author: Markus Malkusch ([email protected])
Inheritance: implements phpmock\functions\FunctionProvider
Show file Open project: php-mock/php-mock

Public Methods

Method Description
__construct ( array $incrementables = [] ) Sets the Incrementable objects.
addIncrementable ( phpmock\functions\Incrementable $incrementable ) Adds an Incrementable object.
getCallable ( ) : callable Returns the sleep() mock function.

Protected Methods

Method Description
convertToSeconds ( integer $amount ) : mixed Converts the sleep() parameter into seconds.

Method Details

__construct() public method

Sets the Incrementable objects.
See also: addIncrementable()
public __construct ( array $incrementables = [] )
$incrementables array Observing Incrementables.

addIncrementable() public method

These objects are observing this function and get notified by increasing the amount of passed time. Incrementables are used for time() and microtime() mocks.
public addIncrementable ( phpmock\functions\Incrementable $incrementable )
$incrementable phpmock\functions\Incrementable Observing Incrementable.

convertToSeconds() abstract protected method

Converts the sleep() parameter into seconds.
abstract protected convertToSeconds ( integer $amount ) : mixed
$amount integer Amount of time units.
return mixed Seconds.

getCallable() public method

A call will increase all registered Increment objects.
public getCallable ( ) : callable
return callable The callable for this object.