Class MockConfiguration
This class describes the configuration of mocks and hides away some of the reflection implementation
public
|
#
__construct( array $targets = array(), array $blackListedMethods = array(), array $whiteListedMethods = array(), $name = null, $instanceMock = false, array $parameterOverrides = array() )
|
public
string
|
|
public
|
#
getMethodsToMock( )
Gets a list of methods from the classes, interfaces and objects and filters them appropriately. Lot's of filtering going on, perhaps we could have filter classes to iterate through |
public
|
#
requiresCallTypeHintRemoval( )
We declare the __call method to handle undefined stuff, if the class we're mocking has also defined it, we need to comply with their interface |
public
|
#
requiresCallStaticTypeHintRemoval( )
We declare the __callStatic method to handle undefined stuff, if the class we're mocking has also defined it, we need to comply with their interface |
public
|
|
protected
|
|
protected
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
protected
|
|
protected
|
|
protected
|
#
addTargetInterfaceName( $targetInterface )
If we attempt to implement Traversable, we must ensure we are also implementing either Iterator or IteratorAggregate, and that whichever one it is comes before Traversable in the list of implements. |
protected
|
protected static
integer
|
$mockCounter
|
#
0
|
protected
|
$targetClass
A class that we'd like to mock |
|
protected
|
$targetClassName
|
|
protected
array
|
$targetInterfaces
A number of interfaces we'd like to mock, keyed by name to attempt to keep unique |
#
array()
|
protected
array
|
$targetInterfaceNames
|
#
array()
|
protected
|
$targetObject
An object we'd like our mock to proxy to |
|
protected
|
$name
The class name we'd like to use for a generated mock |
|
protected
array
|
$blackListedMethods
Methods that should specifically not be mocked |
#
array()
|
protected
array
|
$whiteListedMethods
If not empty, only these methods will be mocked |
#
array()
|
protected
boolean
|
$instanceMock
An instance mock is where we override the original class before it's autoloaded |
#
false
|
protected
array
|
$parameterOverrides
Param overrides |
#
array()
|
protected
|
$allMethods
Instance cache of all methods |