PHP Класс Eloquent\Phony\Spy\SpyVerifier

Наследование: extends Eloquent\Phony\Verification\AbstractCardinalityVerifier, implements Eloquent\Phony\Spy\Spy
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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.