\ChadicusFunctionRegistry

This class if for overriding global functions for use within unit tests.

Summary

Methods
Properties
Constants
set()
get()
reset()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

set()

set(string  $namespace, string  $name, callable  $function) : void

Register a new function for testing.

Parameters

string $namespace

The namespace from which the global function will be called.

string $name

The function name.

callable $function

The callable to execute.

get()

get(string  $name) : callable

Returns the custom function or the global function.

Parameters

string $name

The function name.

Returns

callable

reset()

reset(string  $namespace = null, array  $extensions = array()) : void

Sets all custom function properties to null.

Parameters

string $namespace

The namespace from which the global function will be called.

array $extensions

Array of PHP extensions whose functions will be mocked.