Class Mock
- Mockery\Mock implements Mockery\MockInterface
public
|
#
mockery_init(
We want to avoid constructors since class is copied to Generator.php for inclusion on extending class definitions. |
public
|
|
public
|
#
shouldAllowMockingMethod( String $method )
Allows additional methods to be mocked that do not explicitly exist on mocked class |
public
|
#
shouldIgnoreMissing( mixed $returnValue = null )
Set mock to ignore unexpected methods and return Undefined class |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
shouldExpect(
Accepts a closure which is executed with an object recorder which proxies to the partial source object. The intent being to record the interactions of a concrete object as a set of expectations on the current mock object. The partial may then be passed to a second process to see if it fulfils the same (or exact same) contract as the original. |
public
|
|
public
|
|
public static
|
|
public
|
|
public
|
|
public
|
|
public
integer
|
|
public
|
|
public
array
|
|
public
|
|
public
integer
|
|
public
|
|
public
integer
|
|
public
|
#
mockery_setExpectationsFor( $method,
Return the expectations director for the given method |
public
|
|
public
|
#
mockery_findExpectation( $method, array $args )
Find an expectation matching the given method and arguments |
public
|
|
public
string
|
|
public
array
|
|
public
|
|
public
|
|
public
mixed
|
#
mockery_callSubjectMethod( string $name, array $args )
Calls a parent class method and returns the result. Used in a passthru expectation where a real return value is required while still taking advantage of expectation matching and call count verification. |
public
string[]
|
|
public
boolean
|
|
public
|
|
public
|
|
public
|
|
public
null
|
|
protected static
|
|
protected
|
|
protected
|
|
protected
|
protected
array
|
$_mockery_expectations
Stores an array of all expectation directors for this mock |
#
array()
|
protected
boolean
|
$_mockery_ignoreMissing
Flag to indicate whether we can ignore method calls missing from our expectations |
#
false
|
protected
boolean
|
$_mockery_deferMissing
Flag to indicate whether we can defer method calls missing from our expectations |
#
false
|
protected
boolean
|
$_mockery_verified
Flag to indicate whether this mock was verified |
#
false
|
protected
string
|
$_mockery_name
Given name of the mock |
#
null
|
protected
integer
|
$_mockery_allocatedOrder
Order number of allocation |
#
0
|
protected
integer
|
$_mockery_currentOrder
Current ordered number |
#
0
|
protected
array
|
$_mockery_groups
Ordered groups |
#
array()
|
protected
|
$_mockery_container
Mock container containing this mock object |
#
null
|
protected
object
|
$_mockery_partial
Instance of a core object on which methods are called in the event it has been set, and an expectation for one of the object's methods does not exist. This implements a simple partial mock proxy system. |
#
null
|
protected
boolean
|
$_mockery_disableExpectationMatching
Flag to indicate we should ignore all expectations temporarily. Used mainly to prevent expectation matching when in the middle of a mock object recording session. |
#
false
|
protected
array
|
$_mockery_mockableProperties
Stores all stubbed public methods separate from any on-object public properties that may exist. |
#
array()
|
protected
array
|
$_mockery_mockableMethods
|
#
array()
|
protected static
|
$_mockery_methods
Just a local cache for this mock's target's methods |
|
protected
boolean
|
$_mockery_allowMockingProtectedMethods
|
#
false
|
protected
|
$_mockery_receivedMethodCalls
|
|
protected
mixed
|
$_mockery_defaultReturnValue
If shouldIgnoreMissing is called, this value will be returned on all calls to missing methods |
#
null
|