Property | Type | Description | |
---|---|---|---|
$_actualCount | integer | Actual count of calls to this expectation | |
$_closureQueue | array | Array of closures executed with given arguments to generate a result to be returned | |
$_countValidatorClass | string | The count validator class to use | |
$_countValidators | array | Count validator store | |
$_expectedArgs | array | Arguments expected by this expectation | |
$_globalOrderNumber | integer | Integer representing the call order of this expectation on a global basis | |
$_globally | boolean | Flag indicating whether the order of calling is determined locally or globally | |
$_mock | object | Mock object to which this expectation belongs | |
$_name | string | Method name | |
$_noArgsExpectation | boolean | Flag indicating we expect no arguments | |
$_orderNumber | integer | Integer representing the call order of this expectation | |
$_passthru | boolean | Flag indicating if the return value should be obtained from the original class method instead of returning predefined values from the return queue | |
$_returnQueue | array | Array of return values as a queue for multiple return sequence | |
$_returnValue | mixed | Value to return from this expectation | |
$_setQueue | array | Array of values to be set when this expectation matches | |
$_throw | boolean | Flag indicating that an exception is expected to be throw (not returned) |
Method | Description | |
---|---|---|
__clone ( ) | Cloning logic | |
__construct ( Mockery\MockInterface $mock, string $name ) | Constructor | |
__toString ( ) : string | Return a string with the method name and arguments formatted | |
andReturn ( ) : self | Set a return value, or sequential queue of return values | |
andReturnFalse ( ) | ||
andReturnNull ( ) : self | Return null. This is merely a language construct for Mock describing. | |
andReturnSelf ( ) : self | Return this mock, like a fluent interface | |
andReturnTrue ( ) | ||
andReturnUndefined ( ) : self | Return a self-returning black hole object. | |
andReturnUsing ( ) : self | Set a closure or sequence of closures with which to generate return values. The arguments passed to the expected method are passed to the closures as parameters. | |
andReturnValues ( array $values ) : self | Set a sequential queue of return values with an array | |
andSet ( string $name, mixed $value ) : self | Register values to be set to a public property each time this expectation occurs | |
andThrow ( string | Exception $exception, string $message = '', integer $code, Exception $previous = null ) : self | Set Exception class and arguments to that class to be thrown | |
andThrowExceptions ( array $exceptions ) : self | Set Exception classes to be thrown | |
atLeast ( ) : self | Sets next count validator to the AtLeast instance | |
atMost ( ) : self | Sets next count validator to the AtMost instance | |
between ( integer $minimum, integer $maximum ) | Shorthand for setting minimum and maximum constraints on call counts | |
byDefault ( ) : self | Mark this expectation as being a default | |
getMock ( ) : Mockery\MockInterface | Return the parent mock of the expectation | |
getName ( ) | ||
getOrderNumber ( ) : integer | Return order number | |
globally ( ) : self | Indicates call order should apply globally | |
isCallCountConstrained ( ) : boolean | Check if there is a constraint on call count | |
isEligible ( ) : boolean | Checks if this expectation is eligible for additional calls | |
matchArgs ( array $args ) : boolean | Check if passed arguments match an argument expectation | |
never ( ) : self | Indicates that this expectation is never expected to be called | |
once ( ) : self | Indicates that this expectation is expected exactly once | |
ordered ( string $group = null ) : self | Indicates that this expectation must be called in a specific given order | |
passthru ( ) : self | Flag this expectation as calling the original class method with the any provided arguments instead of using a return value queue. | |
set ( string $name, mixed $value ) : self | Alias to andSet(). Allows the natural English construct - set('foo', 'bar')->andReturn('bar') | |
times ( integer $limit = null ) : self | Indicates the number of times this expectation should occur | |
twice ( ) : self | Indicates that this expectation is expected exactly twice | |
validateOrder ( ) : void | Verify call order | |
verify ( ) : boolean | Verify this expectation | |
verifyCall ( array $args ) : mixed | Verify the current call, i.e. that the given arguments match those of this expectation | |
with ( ) : self | Expected argument setter for the expectation | |
withAnyArgs ( ) : self | Set expectation that any arguments are acceptable | |
withArgs ( array | Closur\Closure $argsOrClosure ) : self | Expected arguments for the expectation passed as an array or a closure that matches each passed argument on each function call. | |
withNoArgs ( ) : self | Set with() as no arguments expected | |
zeroOrMoreTimes ( ) : self | Indicates this expectation should occur zero or more times |
Method | Description | |
---|---|---|
_defineOrdered ( string $group, object $ordering ) : integer | Setup the ordering tracking on the mock or mock container | |
_getReturnValue ( array $args ) : mixed | Fetch the return value for the matching args | |
_matchArg ( mixed $expected, &$actual ) : boolean | Check if passed argument matches an argument expectation | |
_setValues ( ) : mixed | Sets public properties with queued values to the mock object |
Method | Description | |
---|---|---|
isMultiArgumentClosureExpectation ( ) : boolean | Check if the registered expectation is a MultiArgumentClosureExpectation. | |
withArgsInArray ( array $arguments ) : self | Expected arguments for the expectation passed as an array | |
withArgsMatchedByClosure ( Closur\Closure $closure ) : self | Expected arguments have to be matched by the given closure. |
public __construct ( Mockery\MockInterface $mock, string $name ) | ||
$mock | Mockery\MockInterface | |
$name | string |
public __toString ( ) : string | ||
return | string |
protected _getReturnValue ( array $args ) : mixed | ||
$args | array | |
return | mixed |
protected _setValues ( ) : mixed | ||
return | mixed |
public andReturn ( ) : self | ||
return | self |
public andReturnNull ( ) : self | ||
return | self |
public andReturnSelf ( ) : self | ||
return | self |
public andReturnUndefined ( ) : self | ||
return | self |
public andReturnUsing ( ) : self | ||
return | self |
public andReturnValues ( array $values ) : self | ||
$values | array | |
return | self |
public andThrowExceptions ( array $exceptions ) : self | ||
$exceptions | array | |
return | self |
public atLeast ( ) : self | ||
return | self |
public atMost ( ) : self | ||
return | self |
public byDefault ( ) : self | ||
return | self |
public getMock ( ) : Mockery\MockInterface | ||
return | Mockery\MockInterface |
public getOrderNumber ( ) : integer | ||
return | integer |
public globally ( ) : self | ||
return | self |
public isCallCountConstrained ( ) : boolean | ||
return | boolean |
public isEligible ( ) : boolean | ||
return | boolean |
public never ( ) : self | ||
return | self |
public once ( ) : self | ||
return | self |
public passthru ( ) : self | ||
return | self |
public twice ( ) : self | ||
return | self |
public verifyCall ( array $args ) : mixed | ||
$args | array | |
return | mixed |
public with ( ) : self | ||
return | self |
public withAnyArgs ( ) : self | ||
return | self |
public withNoArgs ( ) : self | ||
return | self |
public zeroOrMoreTimes ( ) : self | ||
return | self |
protected int $_actualCount | ||
return | integer |
protected array $_closureQueue | ||
return | array |
protected string $_countValidatorClass | ||
return | string |
protected array $_countValidators | ||
return | array |
protected array $_expectedArgs | ||
return | array |
protected int $_globalOrderNumber | ||
return | integer |
protected bool $_globally | ||
return | boolean |
protected object $_mock | ||
return | object |
protected bool $_noArgsExpectation | ||
return | boolean |
protected int $_orderNumber | ||
return | integer |
protected bool $_passthru | ||
return | boolean |
protected array $_returnQueue | ||
return | array |
protected mixed $_returnValue | ||
return | mixed |
protected array $_setQueue | ||
return | array |
protected bool $_throw | ||
return | boolean |