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

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

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

Метод Описание
__construct ( callable | null $callback, string | null $label, CallFactory $callFactory, Invoker $invoker, GeneratorSpyFactory $generatorSpyFactory, IterableSpyFactory $iterableSpyFactory ) Construct a new spy.
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 ) : Eloquent\Phony\Call\Call Get a call by index.
callCount ( ) : integer Get the number of calls.
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.
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.
invokeWith ( Arguments | array $arguments = [] ) : mixed Invoke this object.
lastCall ( ) : Eloquent\Phony\Call\Call Get the last call.
lastEvent ( ) : Eloquent\Phony\Event\Event Get the last event.
nextIndex ( ) : integer Get the next call index.
setCalls ( array $calls ) Set the calls.
setUseGeneratorSpies ( boolean $useGeneratorSpies ) Turn on or off the use of generator spies.
setUseIterableSpies ( boolean $useIterableSpies ) Turn on or off the use of iterable spies.
startRecording ( ) Start recording calls.
stopRecording ( ) Stop recording calls.
useGeneratorSpies ( ) : boolean Returns true if this spy uses generator spies.
useIterableSpies ( ) : boolean Returns true if this spy uses iterable spies.

Приватные методы

Метод Описание
normalizeIndex ( $size, $index, &$normalized = null )

Описание методов

__construct() публичный метод

Construct a new spy.
public __construct ( callable | null $callback, string | null $label, CallFactory $callFactory, Invoker $invoker, GeneratorSpyFactory $generatorSpyFactory, IterableSpyFactory $iterableSpyFactory )
$callback callable | null The callback, or null to create an anonymous spy.
$label string | null The label.
$callFactory Eloquent\Phony\Call\CallFactory The call factory to use.
$invoker Eloquent\Phony\Invocation\Invoker The invoker to use.
$generatorSpyFactory GeneratorSpyFactory The generator spy factory to use.
$iterableSpyFactory IterableSpyFactory The iterable spy factory to use.

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 ) : 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.

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.

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.

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.

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.

nextIndex() публичный метод

Get the next call index.
public nextIndex ( ) : integer
Результат integer The index.

setCalls() публичный метод

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

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.

startRecording() публичный метод

Start recording calls.
public startRecording ( )

stopRecording() публичный метод

Stop recording calls.
public stopRecording ( )

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.