Set the timestamp as float.
public setMicrotimeAsFloat ( float $timestamp ) | ||
$timestamp | float | The timestamp as float. |
/** * Tests getCallable() * * @test */ public function testGetCallable() { $function = new FixedMicrotimeFunction(); $function->setMicrotimeAsFloat(1.00000001); $builder = new MockBuilder(); $builder->setNamespace(__NAMESPACE__)->setName("microtime")->setFunctionProvider($function); $mock = $builder->build(); $mock->enable(); $this->assertEquals("0.00000001 1", microtime()); $this->assertEquals(1.00000001, microtime(true)); $mock->disable(); }