phpmock\functions\AbstractSleepFunctionTest::testSleepIncrementation PHP Method

testSleepIncrementation() public method

Tests incrementation of Incrementables
public testSleepIncrementation ( AbstractSleepFunction $sleepFunction, integer $amount, mixed $expected )
$sleepFunction AbstractSleepFunction Tested implementation.
$amount integer Amount of time units.
$expected mixed Expected seconds.
    public function testSleepIncrementation(AbstractSleepFunction $sleepFunction, $amount, $expected)
    {
        $value = new FixedValueFunction(0);
        $sleepFunction->addIncrementable($value);
        call_user_func($sleepFunction->getCallable(), $amount);
        $this->assertEquals($expected, call_user_func($value->getCallable()));
    }