Property | Type | Description | |
---|---|---|---|
$_mockery_allocatedOrder | integer | Order number of allocation | |
$_mockery_allowMockingProtectedMethods | |||
$_mockery_container | Mock container containing this mock object | ||
$_mockery_currentOrder | integer | Current ordered number | |
$_mockery_defaultReturnValue | mixed | If shouldIgnoreMissing is called, this value will be returned on all calls to missing methods | |
$_mockery_deferMissing | boolean | Flag to indicate whether we can defer method calls missing from our expectations | |
$_mockery_disableExpectationMatching | boolean | 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. | |
$_mockery_expectations | array | Stores an array of all expectation directors for this mock | |
$_mockery_expectations_count | integer | Stores an inital number of expectations that can be manipulated while using the getter method. | |
$_mockery_groups | array | Ordered groups | |
$_mockery_ignoreMissing | boolean | Flag to indicate whether we can ignore method calls missing from our expectations | |
$_mockery_methods | ReflectionMethod[] | Just a local cache for this mock's target's methods | |
$_mockery_mockableMethods | array | ||
$_mockery_mockableProperties | array | Stores all stubbed public methods separate from any on-object public properties that may exist. | |
$_mockery_name | string | Given name of the mock | |
$_mockery_partial | object | 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. | |
$_mockery_receivedMethodCalls | |||
$_mockery_verified | boolean | Flag to indicate whether this mock was verified |
Method | Description | |
---|---|---|
__call ( $method, array $args ) | Capture calls to this mock | |
__callStatic ( $method, array $args ) | ||
__destruct ( ) | ||
__isset ( $name ) | ||
__toString ( ) | Forward calls to this magic method to the __call method | |
__wakeup ( ) | ||
asUndefined ( ) | ||
byDefault ( ) : self | In the event shouldReceive() accepting one or more methods/returns, this method will switch them from normal expectations to default expectations | |
makePartial ( ) : |
Create an obviously worded alias to shouldDeferMissing() | |
mockery_allocateOrder ( ) : integer | Fetch the next available allocation order number | |
mockery_callSubjectMethod ( string $name, array $args ) : mixed | 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. | |
mockery_findExpectation ( $method, array $args ) : |
Find an expectation matching the given method and arguments | |
mockery_getContainer ( ) : |
Return the container for this mock | |
mockery_getCurrentOrder ( ) : integer | Get current ordered number | |
mockery_getExpectationCount ( ) : integer | Gets the count of expectations for this mock | |
mockery_getExpectations ( ) | ||
mockery_getExpectationsFor ( $method ) : Mockery\ExpectationDirector | null | Return the expectations director for the given method | |
mockery_getGroups ( ) : array | Fetch array of ordered groups | |
mockery_getMethod ( $name ) | ||
mockery_getMockableMethods ( ) : string[] | ||
mockery_getMockableProperties ( ) : array | ||
mockery_getName ( ) : string | Return the name for this mock | |
mockery_init ( |
We want to avoid constructors since class is copied to Generator.php for inclusion on extending class definitions. | |
mockery_isAnonymous ( ) : boolean | ||
mockery_returnValueForMethod ( string $name ) : mixed | ||
mockery_setCurrentOrder ( integer $order ) | Set current ordered number | |
mockery_setExpectationsFor ( $method, Mockery\ExpectationDirector $director ) : Mockery\ExpectationDirector | null | Return the expectations director for the given method | |
mockery_setGroup ( mixed $group, integer $order ) | Set ordering for a group | |
mockery_teardown ( ) : void | Tear down tasks for this mock | |
mockery_validateOrder ( string $method, integer $order ) : void | Validate the current mock's ordering | |
mockery_verify ( ) : void | Iterate across all expectation directors and validate each | |
shouldAllowMockingMethod ( String $method ) : |
Allows additional methods to be mocked that do not explicitly exist on mocked class | |
shouldAllowMockingProtectedMethods ( ) : |
||
shouldDeferMissing ( ) : |
Set mock to defer unexpected methods to it's parent | |
shouldExpect ( Closure $closure ) | 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. | |
shouldHaveReceived ( $method, $args = null ) | ||
shouldIgnoreMissing ( mixed $returnValue = null ) : |
Set mock to ignore unexpected methods and return Undefined class | |
shouldNotHaveReceived ( $method, $args = null ) | ||
shouldNotReceive ( $methodName ) : |
Shortcut method for setting an expectation that a method should not be called. | |
shouldReceive ( $methodName ) : |
Set expected method calls |
Method | Description | |
---|---|---|
_mockery_getReceivedMethodCalls ( ) | ||
_mockery_handleMethodCall ( $method, array $args ) | ||
_mockery_handleStaticMethodCall ( $method, array $args ) | ||
mockery_getMethods ( ) : array | Uses reflection to get the list of all methods within the current mock object |
Method | Description | |
---|---|---|
getNonPublicMethods ( ) : array | ||
hasMethodOverloadingInParentClass ( ) |
public __toString ( ) |
protected _mockery_handleMethodCall ( $method, array $args ) | ||
$args | array |
protected static _mockery_handleStaticMethodCall ( $method, array $args ) | ||
$args | array |
public byDefault ( ) : self | ||
return | self |
public makePartial ( ) : |
||
return |
public mockery_allocateOrder ( ) : integer | ||
return | integer |
public mockery_findExpectation ( $method, array $args ) : |
||
$args | array | |
return |
public mockery_getContainer ( ) : |
||
return |
public mockery_getCurrentOrder ( ) : integer | ||
return | integer |
public mockery_getExpectationCount ( ) : integer | ||
return | integer |
public mockery_getExpectationsFor ( $method ) : Mockery\ExpectationDirector | null | ||
return | Mockery\ExpectationDirector | null |
public mockery_getGroups ( ) : array | ||
return | array |
protected mockery_getMethods ( ) : array | ||
return | array |
public mockery_getMockableMethods ( ) : string[] | ||
return | string[] |
public mockery_getMockableProperties ( ) : array | ||
return | array |
public mockery_getName ( ) : string | ||
return | string |
public mockery_init ( |
||
$container | ||
$partialObject | object | |
return | void |
public mockery_returnValueForMethod ( string $name ) : mixed | ||
$name | string | Method name. |
return | mixed | Generated return value based on the declared return value of the named method. |
public mockery_setCurrentOrder ( integer $order ) | ||
$order | integer |
public mockery_setExpectationsFor ( $method, Mockery\ExpectationDirector $director ) : Mockery\ExpectationDirector | null | ||
$director | Mockery\ExpectationDirector | |
return | Mockery\ExpectationDirector | null |
public mockery_setGroup ( mixed $group, integer $order ) | ||
$group | mixed | |
$order | integer |
public mockery_teardown ( ) : void | ||
return | void |
public mockery_verify ( ) : void | ||
return | void |
public shouldAllowMockingMethod ( String $method ) : |
||
$method | String | name of the method to be mocked |
return |
public shouldAllowMockingProtectedMethods ( ) : |
||
return |
public shouldDeferMissing ( ) : |
||
return |
public shouldExpect ( Closure $closure ) | ||
$closure | Closure |
public shouldIgnoreMissing ( mixed $returnValue = null ) : |
||
$returnValue | mixed | the default return value for calls to missing functions on this mock |
return |
public shouldNotReceive ( $methodName ) : |
||
return |
public shouldReceive ( $methodName ) : |
||
return |
protected int $_mockery_allocatedOrder | ||
return | integer |
protected $_mockery_allowMockingProtectedMethods |
protected Container,Mockery $_mockery_container | ||
return |
protected int $_mockery_currentOrder | ||
return | integer |
protected mixed $_mockery_defaultReturnValue | ||
return | mixed |
protected bool $_mockery_deferMissing | ||
return | boolean |
protected bool $_mockery_disableExpectationMatching | ||
return | boolean |
protected array $_mockery_expectations | ||
return | array |
protected int $_mockery_expectations_count | ||
return | integer |
protected bool $_mockery_ignoreMissing | ||
return | boolean |
protected static ReflectionMethod[] $_mockery_methods | ||
return | ReflectionMethod[] |
protected array $_mockery_mockableMethods | ||
return | array |
protected array $_mockery_mockableProperties | ||
return | array |
protected string $_mockery_name | ||
return | string |
protected object $_mockery_partial | ||
return | object |
protected bool $_mockery_verified | ||
return | boolean |