PHP Class phpmock\generator\MockFunctionGenerator

Author: Markus Malkusch ([email protected])
Show file Open project: php-mock/php-mock Class Usage Examples

Public Methods

Method Description
__construct ( Mock $mock ) Sets the mock.
call ( string $functionName, string $fqfn, array &$arguments ) : mixed Calls the enabled mock, or the built-in function otherwise.
defineFunction ( ) Defines the mock function.
removeDefaultArguments ( array &$arguments ) Removes optional arguments.

Method Details

__construct() public method

Sets the mock.
public __construct ( Mock $mock )
$mock phpmock\Mock The mock.

call() public static method

Calls the enabled mock, or the built-in function otherwise.
See also: Mock::define()
public static call ( string $functionName, string $fqfn, array &$arguments ) : mixed
$functionName string The function name.
$fqfn string The fully qualified function name.
$arguments array The arguments.
return mixed The result of the called function.

defineFunction() public method

Defines the mock function.
public defineFunction ( )

removeDefaultArguments() public static method

Removes optional arguments.
public static removeDefaultArguments ( array &$arguments )
$arguments array The arguments.