Overview

Namespaces

  • phpmock
    • environment
    • functions
    • spy

Classes

  • AbstractSleepFunction
  • FixedDateFunction
  • FixedMicrotimeFunction
  • FixedValueFunction
  • SleepFunction
  • UsleepFunction

Interfaces

  • FunctionProvider
  • Incrementable
  • Overview
  • Namespace
  • Class

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
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.

Implementation of

phpmock\functions\FunctionProvider::getCallable()
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.

Suppresswarnings(phpmd)

public integer
# getTime( )

Returns the time without the microseconds.

Returns the time without the microseconds.

Returns

integer
The time.
API documentation generated by ApiGen