Метод | Описание | |
---|---|---|
__construct ( Eloquent\Phony\Call\Call $call, |
Construct a new call verifier. | |
addIterableEvent ( Eloquent\Phony\Call\Event\IterableEvent $iterableEvent ) | Add an iterable event. | |
allCalls ( ) : array |
Get all calls as an array. | |
allEvents ( ) : array |
Get all events as an array. | |
argument ( integer $index ) : mixed | Get an argument by index. | |
argumentCount ( ) : integer | Get the number of arguments. | |
arguments ( ) : |
Get the received arguments. | |
callAt ( integer $index ) : Eloquent\Phony\Call\Call | Get a call by index. | |
callCount ( ) : integer | Get the number of calls. | |
callback ( ) : callable | Get the callback. | |
calledEvent ( ) : |
Get the 'called' event. | |
calledWith ( ) : Eloquent\Phony\Event\EventCollection | Throws an exception unless called with the supplied arguments. | |
checkCalledWith ( ) : Eloquent\Phony\Event\EventCollection | null | Checks if called with the supplied arguments. | |
checkCompleted ( ) : Eloquent\Phony\Event\EventCollection | null | Checks if this call completed. | |
checkGenerated ( ) : |
Checks if this call returned a generator. | |
checkIterated ( ) : |
Checks if this call returned an iterable. | |
checkResponded ( ) : Eloquent\Phony\Event\EventCollection | null | Checks if this call responded. | |
checkReturned ( mixed $value = null ) : Eloquent\Phony\Event\EventCollection | null | Checks if this call returned the supplied value. | |
checkThrew ( Eloquent\Phony\Matcher\Matcher | Exceptio\Exception | Erro\Error | string | null $type = null ) : Eloquent\Phony\Event\EventCollection | null | Checks if an exception of the supplied type was thrown. | |
completed ( ) : Eloquent\Phony\Event\EventCollection | Throws an exception unless this call completed. | |
count ( ) : integer | Get the event count. | |
duration ( ) : float | null | Get the call duration. | |
endEvent ( ) : Eloquent\Phony\Call\Event\EndEvent | null | Get the end event. | |
endTime ( ) : float | null | Get the time at which the call completed. | |
eventAt ( integer $index ) : Eloquent\Phony\Event\Event | Get an event by index. | |
eventCount ( ) : integer | Get the number of events. | |
exception ( ) : Exceptio\Exception | Erro\Error | Get the thrown exception. | |
firstCall ( ) : Eloquent\Phony\Call\Call | Get the first call. | |
firstEvent ( ) : Eloquent\Phony\Event\Event | Get the first event. | |
generated ( ) : |
Throws an exception unless this call returned a generator. | |
generatorException ( ) : Exceptio\Exception | Erro\Error | Get the exception thrown from the generator. | |
generatorResponse ( ) : tuple |
Get the response from the generator. | |
generatorReturnValue ( ) : mixed | Get the value returned from the generator. | |
getIterator ( ) : Iterator | Get an iterator for this collection. | |
hasCalls ( ) : boolean | Returns true if this collection contains any calls. | |
hasCompleted ( ) : boolean | Returns true if this call has completed. | |
hasEvents ( ) : boolean | Returns true if this collection contains any events. | |
hasResponded ( ) : boolean | Returns true if this call has responded. | |
index ( ) : integer | Get the call index. | |
isGenerator ( ) : boolean | Returns true if this call has responded with a generator. | |
isIterable ( ) : boolean | Returns true if this call has responded with an iterable. | |
iterableEvents ( ) : array |
Get the iterable events. | |
iterated ( ) : |
Throws an exception unless this call returned an iterable. | |
lastCall ( ) : Eloquent\Phony\Call\Call | Get the last call. | |
lastEvent ( ) : Eloquent\Phony\Event\Event | Get the last event. | |
responded ( ) : Eloquent\Phony\Event\EventCollection | Throws an exception unless this call responded. | |
response ( ) : tuple |
Get the response. | |
responseDuration ( ) : float | null | Get the call response duration. | |
responseEvent ( ) : Eloquent\Phony\Call\Event\ResponseEvent | null | Get the response event. | |
responseTime ( ) : float | null | Get the time at which the call responded. | |
returnValue ( ) : mixed | Get the returned value. | |
returned ( mixed $value = null ) : Eloquent\Phony\Event\EventCollection | Throws an exception unless this call returned the supplied value. | |
sequenceNumber ( ) : integer | Get the sequence number. | |
setEndEvent ( Eloquent\Phony\Call\Event\EndEvent $endEvent ) | Set the end event. | |
setResponseEvent ( Eloquent\Phony\Call\Event\ResponseEvent $responseEvent ) | Set the response event. | |
threw ( Eloquent\Phony\Matcher\Matcher | Exceptio\Exception | Erro\Error | string | null $type = null ) : Eloquent\Phony\Event\EventCollection | Throws an exception unless this call threw an exception of the supplied type. | |
time ( ) : float | Get the time at which the event occurred. |
Метод | Описание | |
---|---|---|
matchIf ( $event, $checkResult ) |
public __construct ( Eloquent\Phony\Call\Call $call, |
||
$call | Eloquent\Phony\Call\Call | The call. |
$matcherFactory | The matcher factory to use. | |
$matcherVerifier | The matcher verifier to use. | |
$generatorVerifierFactory | The generator verifier factory to use. | |
$iterableVerifierFactory | The iterable verifier factory to use. | |
$assertionRecorder | Eloquent\Phony\Assertion\AssertionRecorder | The assertion recorder to use. |
$assertionRenderer | The assertion renderer to use. |
public addIterableEvent ( Eloquent\Phony\Call\Event\IterableEvent $iterableEvent ) | ||
$iterableEvent | Eloquent\Phony\Call\Event\IterableEvent | The iterable event. |
public allEvents ( ) : array |
||
Результат | array |
public argumentCount ( ) : integer | ||
Результат | integer | The number of arguments. |
public arguments ( ) : |
||
Результат | The received arguments. |
public calledEvent ( ) : |
||
Результат | The 'called' event. |
public calledWith ( ) : Eloquent\Phony\Event\EventCollection | ||
Результат | Eloquent\Phony\Event\EventCollection | The result. |
public checkCalledWith ( ) : Eloquent\Phony\Event\EventCollection | null | ||
Результат | Eloquent\Phony\Event\EventCollection | null | The result. |
public checkCompleted ( ) : Eloquent\Phony\Event\EventCollection | null | ||
Результат | Eloquent\Phony\Event\EventCollection | null | The result. |
public checkGenerated ( ) : |
||
Результат | The result. |
public checkIterated ( ) : |
||
Результат | The result. |
public checkResponded ( ) : Eloquent\Phony\Event\EventCollection | null | ||
Результат | Eloquent\Phony\Event\EventCollection | null | The result. |
public checkReturned ( mixed $value = null ) : Eloquent\Phony\Event\EventCollection | null | ||
$value | mixed | The value. |
Результат | Eloquent\Phony\Event\EventCollection | null | The result. |
public checkThrew ( Eloquent\Phony\Matcher\Matcher | Exceptio\Exception | Erro\Error | string | null $type = null ) : Eloquent\Phony\Event\EventCollection | null | ||
$type | Eloquent\Phony\Matcher\Matcher | Exceptio\Exception | Erro\Error | string | null | An exception to match, the type of exception, or null for any exception. |
Результат | Eloquent\Phony\Event\EventCollection | null | The result. |
public completed ( ) : Eloquent\Phony\Event\EventCollection | ||
Результат | Eloquent\Phony\Event\EventCollection | The result. |
public eventCount ( ) : integer | ||
Результат | integer | The event count. |
public exception ( ) : Exceptio\Exception | Erro\Error | ||
Результат | Exceptio\Exception | Erro\Error | The thrown exception. |
public firstCall ( ) : Eloquent\Phony\Call\Call | ||
Результат | Eloquent\Phony\Call\Call | The call. |
public firstEvent ( ) : Eloquent\Phony\Event\Event | ||
Результат | Eloquent\Phony\Event\Event | The event. |
public generated ( ) : |
||
Результат | The result. |
public generatorException ( ) : Exceptio\Exception | Erro\Error | ||
Результат | Exceptio\Exception | Erro\Error | The thrown exception. |
public generatorResponse ( ) : tuple |
||
Результат | tuple |
public generatorReturnValue ( ) : mixed | ||
Результат | mixed | The returned value. |
public getIterator ( ) : Iterator | ||
Результат | Iterator | The iterator. |
public hasCompleted ( ) : boolean | ||
Результат | boolean | True if this call has completed. |
public hasResponded ( ) : boolean | ||
Результат | boolean | True if this call has responded. |
public isGenerator ( ) : boolean | ||
Результат | boolean | True if this call has responded with a generator. |
public isIterable ( ) : boolean | ||
Результат | boolean | True if this call has responded with an iterable. |
public iterableEvents ( ) : array |
||
Результат | array |
public iterated ( ) : |
||
Результат | The result. |
public lastCall ( ) : Eloquent\Phony\Call\Call | ||
Результат | Eloquent\Phony\Call\Call | The call. |
public lastEvent ( ) : Eloquent\Phony\Event\Event | ||
Результат | Eloquent\Phony\Event\Event | The event. |
public responded ( ) : Eloquent\Phony\Event\EventCollection | ||
Результат | Eloquent\Phony\Event\EventCollection | The result. |
public responseDuration ( ) : float | null | ||
Результат | float | null | The call response duration in seconds, or null if the call has not yet responded. |
public responseEvent ( ) : Eloquent\Phony\Call\Event\ResponseEvent | null | ||
Результат | Eloquent\Phony\Call\Event\ResponseEvent | null | The response event, or null if the call has not yet responded. |
public responseTime ( ) : float | null | ||
Результат | float | null | The time at which the call responded, in seconds since the Unix epoch, or null if the call has not yet responded. |
public returnValue ( ) : mixed | ||
Результат | mixed | The returned value. |
public sequenceNumber ( ) : integer | ||
Результат | integer | The sequence number. |
public setEndEvent ( Eloquent\Phony\Call\Event\EndEvent $endEvent ) | ||
$endEvent | Eloquent\Phony\Call\Event\EndEvent | The end event. |
public setResponseEvent ( Eloquent\Phony\Call\Event\ResponseEvent $responseEvent ) | ||
$responseEvent | Eloquent\Phony\Call\Event\ResponseEvent | The response event. |
public threw ( Eloquent\Phony\Matcher\Matcher | Exceptio\Exception | Erro\Error | string | null $type = null ) : Eloquent\Phony\Event\EventCollection | ||
$type | Eloquent\Phony\Matcher\Matcher | Exceptio\Exception | Erro\Error | string | null | An exception to match, the type of exception, or null for any exception. |
Результат | Eloquent\Phony\Event\EventCollection | The result. |