PHP 클래스 Eloquent\Phony\Call\CallVerifier

상속: extends Eloquent\Phony\Verification\AbstractCardinalityVerifier, implements Eloquent\Phony\Call\Call
파일 보기 프로젝트 열기: eloquent/phony

공개 메소드들

메소드 설명
__construct ( Eloquent\Phony\Call\Call $call, MatcherFactory $matcherFactory, MatcherVerifier $matcherVerifier, GeneratorVerifierFactory $generatorVerifierFactory, IterableVerifierFactory $iterableVerifierFactory, Eloquent\Phony\Assertion\AssertionRecorder $assertionRecorder, AssertionRenderer $assertionRenderer ) 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 ( ) : 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 ( ) : 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 ( ) : GeneratorVerifier | null Checks if this call returned a generator.
checkIterated ( ) : IterableVerifier | null 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 ( ) : GeneratorVerifier Throws an exception unless this call returned a generator.
generatorException ( ) : Exceptio\Exception | Erro\Error Get the exception thrown from the generator.
generatorResponse ( ) : tuple\null 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 ( ) : IterableVerifier 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\null 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 )

메소드 상세

__construct() 공개 메소드

Construct a new call verifier.
public __construct ( Eloquent\Phony\Call\Call $call, MatcherFactory $matcherFactory, MatcherVerifier $matcherVerifier, GeneratorVerifierFactory $generatorVerifierFactory, IterableVerifierFactory $iterableVerifierFactory, Eloquent\Phony\Assertion\AssertionRecorder $assertionRecorder, AssertionRenderer $assertionRenderer )
$call Eloquent\Phony\Call\Call The call.
$matcherFactory Eloquent\Phony\Matcher\MatcherFactory The matcher factory to use.
$matcherVerifier Eloquent\Phony\Matcher\MatcherVerifier The matcher verifier to use.
$generatorVerifierFactory Eloquent\Phony\Verification\GeneratorVerifierFactory The generator verifier factory to use.
$iterableVerifierFactory Eloquent\Phony\Verification\IterableVerifierFactory The iterable verifier factory to use.
$assertionRecorder Eloquent\Phony\Assertion\AssertionRecorder The assertion recorder to use.
$assertionRenderer Eloquent\Phony\Assertion\AssertionRenderer The assertion renderer to use.

addIterableEvent() 공개 메소드

Add an iterable event.
public addIterableEvent ( Eloquent\Phony\Call\Event\IterableEvent $iterableEvent )
$iterableEvent Eloquent\Phony\Call\Event\IterableEvent The iterable event.

allCalls() 공개 메소드

Get all calls as an array.
public allCalls ( ) : array
리턴 array

allEvents() 공개 메소드

Get all events as an array.
public allEvents ( ) : array
리턴 array

argument() 공개 메소드

Negative indices are offset from the end of the list. That is, -1 indicates the last element, and -2 indicates the second last element.
public argument ( integer $index ) : mixed
$index integer The index.
리턴 mixed The argument.

argumentCount() 공개 메소드

Get the number of arguments.
public argumentCount ( ) : integer
리턴 integer The number of arguments.

arguments() 공개 메소드

Get the received arguments.
public arguments ( ) : Arguments
리턴 Arguments The received arguments.

callAt() 공개 메소드

Negative indices are offset from the end of the list. That is, -1 indicates the last element, and -2 indicates the second last element.
public callAt ( integer $index ) : Eloquent\Phony\Call\Call
$index integer The index.
리턴 Eloquent\Phony\Call\Call The call.

callCount() 공개 메소드

Get the number of calls.
public callCount ( ) : integer
리턴 integer The call count.

callback() 공개 메소드

Get the callback.
public callback ( ) : callable
리턴 callable The callback.

calledEvent() 공개 메소드

Get the 'called' event.
public calledEvent ( ) : CalledEvent
리턴 Eloquent\Phony\Call\Event\CalledEvent The 'called' event.

calledWith() 공개 메소드

Throws an exception unless called with the supplied arguments.
public calledWith ( ) : Eloquent\Phony\Event\EventCollection
리턴 Eloquent\Phony\Event\EventCollection The result.

checkCalledWith() 공개 메소드

Checks if called with the supplied arguments.
public checkCalledWith ( ) : Eloquent\Phony\Event\EventCollection | null
리턴 Eloquent\Phony\Event\EventCollection | null The result.

checkCompleted() 공개 메소드

Checks if this call completed.
public checkCompleted ( ) : Eloquent\Phony\Event\EventCollection | null
리턴 Eloquent\Phony\Event\EventCollection | null The result.

checkGenerated() 공개 메소드

Checks if this call returned a generator.
public checkGenerated ( ) : GeneratorVerifier | null
리턴 Eloquent\Phony\Verification\GeneratorVerifier | null The result.

checkIterated() 공개 메소드

Checks if this call returned an iterable.
public checkIterated ( ) : IterableVerifier | null
리턴 Eloquent\Phony\Verification\IterableVerifier | null The result.

checkResponded() 공개 메소드

Checks if this call responded.
public checkResponded ( ) : Eloquent\Phony\Event\EventCollection | null
리턴 Eloquent\Phony\Event\EventCollection | null The result.

checkReturned() 공개 메소드

When called with no arguments, this method simply checks that the call returned any value.
public checkReturned ( mixed $value = null ) : Eloquent\Phony\Event\EventCollection | null
$value mixed The value.
리턴 Eloquent\Phony\Event\EventCollection | null The result.

checkThrew() 공개 메소드

Checks if an exception of the supplied type was thrown.
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.

completed() 공개 메소드

Throws an exception unless this call completed.
public completed ( ) : Eloquent\Phony\Event\EventCollection
리턴 Eloquent\Phony\Event\EventCollection The result.

count() 공개 메소드

Get the event count.
public count ( ) : integer
리턴 integer The event count.

duration() 공개 메소드

Get the call duration.
public duration ( ) : float | null
리턴 float | null The call duration in seconds, or null if the call has not yet completed.

endEvent() 공개 메소드

Get the end event.
public endEvent ( ) : Eloquent\Phony\Call\Event\EndEvent | null
리턴 Eloquent\Phony\Call\Event\EndEvent | null The end event, or null if the call has not yet completed.

endTime() 공개 메소드

When generator spies are in use, a call that returns a generator will not be considered complete until the generator has been completely consumed via iteration. Similarly, when iterable spies are in use, a call that returns an iterable will not be considered complete until the iterable has been completely consumed via iteration.
public endTime ( ) : float | null
리턴 float | null The time at which the call completed, in seconds since the Unix epoch, or null if the call has not yet completed.

eventAt() 공개 메소드

Negative indices are offset from the end of the list. That is, -1 indicates the last element, and -2 indicates the second last element.
public eventAt ( integer $index ) : Eloquent\Phony\Event\Event
$index integer The index.
리턴 Eloquent\Phony\Event\Event The event.

eventCount() 공개 메소드

Get the number of events.
public eventCount ( ) : integer
리턴 integer The event count.

exception() 공개 메소드

Get the thrown exception.
public exception ( ) : Exceptio\Exception | Erro\Error
리턴 Exceptio\Exception | Erro\Error The thrown exception.

firstCall() 공개 메소드

Get the first call.
public firstCall ( ) : Eloquent\Phony\Call\Call
리턴 Eloquent\Phony\Call\Call The call.

firstEvent() 공개 메소드

Get the first event.
public firstEvent ( ) : Eloquent\Phony\Event\Event
리턴 Eloquent\Phony\Event\Event The event.

generated() 공개 메소드

Throws an exception unless this call returned a generator.
public generated ( ) : GeneratorVerifier
리턴 Eloquent\Phony\Verification\GeneratorVerifier The result.

generatorException() 공개 메소드

Get the exception thrown from the generator.
public generatorException ( ) : Exceptio\Exception | Erro\Error
리턴 Exceptio\Exception | Erro\Error The thrown exception.

generatorResponse() 공개 메소드

Get the response from the generator.
public generatorResponse ( ) : tuple\null
리턴 tuple\null

generatorReturnValue() 공개 메소드

Get the value returned from the generator.
public generatorReturnValue ( ) : mixed
리턴 mixed The returned value.

getIterator() 공개 메소드

Get an iterator for this collection.
public getIterator ( ) : Iterator
리턴 Iterator The iterator.

hasCalls() 공개 메소드

Returns true if this collection contains any calls.
public hasCalls ( ) : boolean
리턴 boolean True if this collection contains any calls.

hasCompleted() 공개 메소드

When generator spies are in use, a call that returns a generator will not be considered complete until the generator has been completely consumed via iteration. Similarly, when iterable spies are in use, a call that returns an iterable will not be considered complete until the iterable has been completely consumed via iteration.
public hasCompleted ( ) : boolean
리턴 boolean True if this call has completed.

hasEvents() 공개 메소드

Returns true if this collection contains any events.
public hasEvents ( ) : boolean
리턴 boolean True if this collection contains any events.

hasResponded() 공개 메소드

A call that has responded has returned a value, or thrown an exception.
public hasResponded ( ) : boolean
리턴 boolean True if this call has responded.

index() 공개 메소드

This number tracks the order of this call with respect to other calls made against the same spy.
public index ( ) : integer
리턴 integer The index.

isGenerator() 공개 메소드

Returns true if this call has responded with a generator.
public isGenerator ( ) : boolean
리턴 boolean True if this call has responded with a generator.

isIterable() 공개 메소드

Returns true if this call has responded with an iterable.
public isIterable ( ) : boolean
리턴 boolean True if this call has responded with an iterable.

iterableEvents() 공개 메소드

Get the iterable events.
public iterableEvents ( ) : array
리턴 array

iterated() 공개 메소드

Throws an exception unless this call returned an iterable.
public iterated ( ) : IterableVerifier
리턴 Eloquent\Phony\Verification\IterableVerifier The result.

lastCall() 공개 메소드

Get the last call.
public lastCall ( ) : Eloquent\Phony\Call\Call
리턴 Eloquent\Phony\Call\Call The call.

lastEvent() 공개 메소드

Get the last event.
public lastEvent ( ) : Eloquent\Phony\Event\Event
리턴 Eloquent\Phony\Event\Event The event.

responded() 공개 메소드

Throws an exception unless this call responded.
public responded ( ) : Eloquent\Phony\Event\EventCollection
리턴 Eloquent\Phony\Event\EventCollection The result.

response() 공개 메소드

Get the response.
public response ( ) : tuple\null
리턴 tuple\null

responseDuration() 공개 메소드

Get the call response duration.
public responseDuration ( ) : float | null
리턴 float | null The call response duration in seconds, or null if the call has not yet responded.

responseEvent() 공개 메소드

Get the response event.
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.

responseTime() 공개 메소드

A call that has responded has returned a value, or thrown an exception.
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.

returnValue() 공개 메소드

Get the returned value.
public returnValue ( ) : mixed
리턴 mixed The returned value.

returned() 공개 메소드

When called with no arguments, this method simply checks that the call returned any value.
public returned ( mixed $value = null ) : Eloquent\Phony\Event\EventCollection
$value mixed The value.
리턴 Eloquent\Phony\Event\EventCollection The result.

sequenceNumber() 공개 메소드

The sequence number is a unique number assigned to every event that Phony records. The numbers are assigned sequentially, meaning that sequence numbers can be used to determine event order.
public sequenceNumber ( ) : integer
리턴 integer The sequence number.

setEndEvent() 공개 메소드

Set the end event.
public setEndEvent ( Eloquent\Phony\Call\Event\EndEvent $endEvent )
$endEvent Eloquent\Phony\Call\Event\EndEvent The end event.

setResponseEvent() 공개 메소드

Set the response event.
public setResponseEvent ( Eloquent\Phony\Call\Event\ResponseEvent $responseEvent )
$responseEvent Eloquent\Phony\Call\Event\ResponseEvent The response event.

threw() 공개 메소드

Throws an exception unless this call threw an exception of the supplied type.
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.

time() 공개 메소드

Get the time at which the event occurred.
public time ( ) : float
리턴 float The time at which the event occurred, in seconds since the Unix epoch.