Свойство | Тип | Описание | |
---|---|---|---|
$_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) |
Метод | Описание | |
---|---|---|
__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 |
Метод | Описание | |
---|---|---|
_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 |
Метод | Описание | |
---|---|---|
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 | ||
Результат | string |
protected _getReturnValue ( array $args ) : mixed | ||
$args | array | |
Результат | mixed |
protected _setValues ( ) : mixed | ||
Результат | mixed |
public andReturn ( ) : self | ||
Результат | self |
public andReturnNull ( ) : self | ||
Результат | self |
public andReturnSelf ( ) : self | ||
Результат | self |
public andReturnUndefined ( ) : self | ||
Результат | self |
public andReturnUsing ( ) : self | ||
Результат | self |
public andReturnValues ( array $values ) : self | ||
$values | array | |
Результат | self |
public andThrowExceptions ( array $exceptions ) : self | ||
$exceptions | array | |
Результат | self |
public atLeast ( ) : self | ||
Результат | self |
public atMost ( ) : self | ||
Результат | self |
public byDefault ( ) : self | ||
Результат | self |
public getMock ( ) : Mockery\MockInterface | ||
Результат | Mockery\MockInterface |
public getOrderNumber ( ) : integer | ||
Результат | integer |
public globally ( ) : self | ||
Результат | self |
public isCallCountConstrained ( ) : boolean | ||
Результат | boolean |
public isEligible ( ) : boolean | ||
Результат | boolean |
public never ( ) : self | ||
Результат | self |
public once ( ) : self | ||
Результат | self |
public passthru ( ) : self | ||
Результат | self |
public twice ( ) : self | ||
Результат | self |
public verifyCall ( array $args ) : mixed | ||
$args | array | |
Результат | mixed |
public with ( ) : self | ||
Результат | self |
public withAnyArgs ( ) : self | ||
Результат | self |
public withNoArgs ( ) : self | ||
Результат | self |
public zeroOrMoreTimes ( ) : self | ||
Результат | self |
protected int $_actualCount | ||
Результат | integer |
protected array $_closureQueue | ||
Результат | array |
protected string $_countValidatorClass | ||
Результат | string |
protected array $_countValidators | ||
Результат | array |
protected array $_expectedArgs | ||
Результат | array |
protected int $_globalOrderNumber | ||
Результат | integer |
protected bool $_globally | ||
Результат | boolean |
protected object $_mock | ||
Результат | object |
protected bool $_noArgsExpectation | ||
Результат | boolean |
protected int $_orderNumber | ||
Результат | integer |
protected bool $_passthru | ||
Результат | boolean |
protected array $_returnQueue | ||
Результат | array |
protected mixed $_returnValue | ||
Результат | mixed |
protected array $_setQueue | ||
Результат | array |
protected bool $_throw | ||
Результат | boolean |