phpmock\MockBuilder::setFunction PHP Method

setFunction() public method

Use this method if you want to set the mocked behaviour with a callable. Alternatively, you can use {@link setFunctionProvider()} to set it with a {@link FunctionProvider}.
See also: setFunctionProvider()
public setFunction ( callable $function ) : MockBuilder
$function callable The mock function.
return MockBuilder
    public function setFunction(callable $function)
    {
        $this->function = $function;
        return $this;
    }