PHP 클래스 Eloquent\Phony\Spy\SpyVerifier

상속: extends Eloquent\Phony\Verification\AbstractCardinalityVerifier, implements Eloquent\Phony\Spy\Spy
파일 보기 프로젝트 열기: eloquent/phony 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( Eloquent\Phony\Spy\Spy $spy, MatcherFactory $matcherFactory, MatcherVerifier $matcherVerifier, GeneratorVerifierFactory $generatorVerifierFactory, IterableVerifierFactory $iterableVerifierFactory, CallVerifierFactory $callVerifierFactory, Eloquent\Phony\Assertion\AssertionRecorder $assertionRecorder, AssertionRenderer $assertionRenderer ) Construct a new spy verifier.
__invoke ( ) : mixed Invoke this object.
addCall ( Eloquent\Phony\Call\Call $call ) Add a call.
allCalls ( ) : array Get all calls as an array.
allEvents ( ) : array Get all events as an array.
callAt ( integer $index ) : CallVerifier Get a call by index.
callCount ( ) : integer Get the number of calls.
callback ( ) : callable Get the callback.
called ( ) : Eloquent\Phony\Event\EventCollection Throws an exception unless called.
calledWith ( ) : Eloquent\Phony\Event\EventCollection Throws an exception unless called with the supplied arguments.
checkCalled ( ) : Eloquent\Phony\Event\EventCollection | null Checks if called.
checkCalledWith ( ) : Eloquent\Phony\Event\EventCollection | null Checks if called with the supplied arguments.
checkCompleted ( ) : Eloquent\Phony\Event\EventCollection | null Checks if this spy completed.
checkGenerated ( ) : GeneratorVerifier | null Checks if this spy returned a generator.
checkIterated ( ) : IterableVerifier | null Checks if this spy returned an iterable.
checkResponded ( ) : Eloquent\Phony\Event\EventCollection | null Checks if this spy responded.
checkReturned ( mixed $value = null ) : Eloquent\Phony\Event\EventCollection | null Checks if this spy 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 spy completed.
count ( ) : integer Get the event count.
eventAt ( integer $index ) : Eloquent\Phony\Event\Event Get an event by index.
eventCount ( ) : integer Get the number of events.
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 spy returned a generator.
getIterator ( ) : Iterator Get an iterator for this collection.
hasCalls ( ) : boolean Returns true if this collection contains any calls.
hasEvents ( ) : boolean Returns true if this collection contains any events.
invoke ( ) : mixed Invoke this object.
invokeWith ( Arguments | array $arguments = [] ) : mixed Invoke this object.
isAnonymous ( ) : boolean Returns true if anonymous.
iterated ( ) : IterableVerifier Throws an exception unless this spy returned an iterable.
label ( ) : string | null Get the label.
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 spy responded.
returned ( mixed $value = null ) : Eloquent\Phony\Event\EventCollection Throws an exception unless this spy returned the supplied value.
setCalls ( array $calls ) Set the calls.
setLabel ( string | null $label ) Set the label.
setUseGeneratorSpies ( boolean $useGeneratorSpies ) Turn on or off the use of generator spies.
setUseIterableSpies ( boolean $useIterableSpies ) Turn on or off the use of iterable spies.
spy ( ) : Eloquent\Phony\Spy\Spy Get the spy.
startRecording ( ) Start recording calls.
stopRecording ( ) Stop recording calls.
threw ( Eloquent\Phony\Matcher\Matcher | Exceptio\Exception | Erro\Error | string | null $type = null ) : Eloquent\Phony\Event\EventCollection Throws an exception unless an exception of the supplied type was thrown.
useGeneratorSpies ( ) : boolean Returns true if this spy uses generator spies.
useIterableSpies ( ) : boolean Returns true if this spy uses iterable spies.

메소드 상세

__construct() 공개 메소드

Construct a new spy verifier.
public __construct ( Eloquent\Phony\Spy\Spy $spy, MatcherFactory $matcherFactory, MatcherVerifier $matcherVerifier, GeneratorVerifierFactory $generatorVerifierFactory, IterableVerifierFactory $iterableVerifierFactory, CallVerifierFactory $callVerifierFactory, Eloquent\Phony\Assertion\AssertionRecorder $assertionRecorder, AssertionRenderer $assertionRenderer )
$spy Eloquent\Phony\Spy\Spy The spy.
$matcherFactory Eloquent\Phony\Matcher\MatcherFactory The matcher factory to use.
$matcherVerifier Eloquent\Phony\Matcher\MatcherVerifier The macther 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.
$callVerifierFactory Eloquent\Phony\Call\CallVerifierFactory The call verifier factory to use.
$assertionRecorder Eloquent\Phony\Assertion\AssertionRecorder The assertion recorder to use.
$assertionRenderer Eloquent\Phony\Assertion\AssertionRenderer The assertion renderer to use.

__invoke() 공개 메소드

Invoke this object.
public __invoke ( ) : mixed
리턴 mixed The result of invocation.

addCall() 공개 메소드

Add a call.
public addCall ( Eloquent\Phony\Call\Call $call )
$call Eloquent\Phony\Call\Call The call.

allCalls() 공개 메소드

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

allEvents() 공개 메소드

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

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 ) : CallVerifier
$index integer The index.
리턴 Eloquent\Phony\Call\CallVerifier 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.

called() 공개 메소드

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

calledWith() 공개 메소드

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

checkCalled() 공개 메소드

Checks if called.
public checkCalled ( ) : Eloquent\Phony\Event\EventCollection | null
리턴 Eloquent\Phony\Event\EventCollection | null 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 spy completed.
public checkCompleted ( ) : Eloquent\Phony\Event\EventCollection | null
리턴 Eloquent\Phony\Event\EventCollection | null The result.

checkGenerated() 공개 메소드

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

checkIterated() 공개 메소드

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

checkResponded() 공개 메소드

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

checkReturned() 공개 메소드

Checks if this spy returned the supplied 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 spy 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.

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.

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 spy returned a generator.
public generated ( ) : GeneratorVerifier
리턴 Eloquent\Phony\Verification\GeneratorVerifier The result.

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.

hasEvents() 공개 메소드

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

invoke() 공개 메소드

Invoke this object.
public invoke ( ) : mixed
리턴 mixed The result of invocation.

invokeWith() 공개 메소드

This method supports reference parameters.
public invokeWith ( Arguments | array $arguments = [] ) : mixed
$arguments Eloquent\Phony\Call\Arguments | array The arguments.
리턴 mixed The result of invocation.

isAnonymous() 공개 메소드

Returns true if anonymous.
public isAnonymous ( ) : boolean
리턴 boolean True if anonymous.

iterated() 공개 메소드

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

label() 공개 메소드

Get the label.
public label ( ) : string | null
리턴 string | null The label.

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 spy responded.
public responded ( ) : Eloquent\Phony\Event\EventCollection
리턴 Eloquent\Phony\Event\EventCollection The result.

returned() 공개 메소드

Throws an exception unless this spy returned the supplied value.
public returned ( mixed $value = null ) : Eloquent\Phony\Event\EventCollection
$value mixed The value.
리턴 Eloquent\Phony\Event\EventCollection The result.

setCalls() 공개 메소드

Set the calls.
public setCalls ( array $calls )
$calls array

setLabel() 공개 메소드

Set the label.
public setLabel ( string | null $label )
$label string | null The label.

setUseGeneratorSpies() 공개 메소드

Turn on or off the use of generator spies.
public setUseGeneratorSpies ( boolean $useGeneratorSpies )
$useGeneratorSpies boolean True to use generator spies.

setUseIterableSpies() 공개 메소드

Turn on or off the use of iterable spies.
public setUseIterableSpies ( boolean $useIterableSpies )
$useIterableSpies boolean True to use iterable spies.

spy() 공개 메소드

Get the spy.
public spy ( ) : Eloquent\Phony\Spy\Spy
리턴 Eloquent\Phony\Spy\Spy The spy.

startRecording() 공개 메소드

Start recording calls.
public startRecording ( )

stopRecording() 공개 메소드

Stop recording calls.
public stopRecording ( )

threw() 공개 메소드

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

useGeneratorSpies() 공개 메소드

Returns true if this spy uses generator spies.
public useGeneratorSpies ( ) : boolean
리턴 boolean True if this spy uses generator spies.

useIterableSpies() 공개 메소드

Returns true if this spy uses iterable spies.
public useIterableSpies ( ) : boolean
리턴 boolean True if this spy uses iterable spies.