PHP Class Eloquent\Phony\Verification\AbstractCardinalityVerifierEventCollection

Inheritance: implements Eloquent\Phony\Verification\CardinalityVerifier, implements Eloquent\Phony\Event\EventCollection
Exibir arquivo Open project: eloquent/phony Class Usage Examples

Protected Properties

Property Type Description
$callCount
$callVerifierFactory
$calls
$cardinality
$eventCount
$events

Public Methods

Method Description
__construct ( array $events, CallVerifierFactory $callVerifierFactory ) Construct a new cardinality verifier event collection.
allCalls ( ) : array Get all calls as an array.
allEvents ( ) : array Get all events as an array.
always ( ) Requires that the next verification matches for all possible items.
atLeast ( integer $minimum ) Requires that the next verification matches a number of times greater than or equal to $minimum.
atMost ( integer $maximum ) Requires that the next verification matches a number of times less than or equal to $maximum.
between ( integer $minimum, integer | null $maximum ) Requires that the next verification matches a number of times greater than or equal to $minimum, and less than or equal to $maximum.
callAt ( integer $index ) : Eloquent\Phony\Call\Call Get a call by index.
callCount ( ) : integer Get the number of calls.
cardinality ( ) : Cardinality Get the cardinality.
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.
lastCall ( ) : Eloquent\Phony\Call\Call Get the last call.
lastEvent ( ) : Eloquent\Phony\Event\Event Get the last event.
never ( ) Requires that the next verification never matches.
once ( ) Requires that the next verification matches only once.
resetCardinality ( ) : Cardinality Reset the cardinality to its default value.
thrice ( ) Requires that the next verification matches exactly three times.
times ( integer $times ) Requires that the next verification matches an exact number of times.
twice ( ) Requires that the next verification matches exactly two times.

Private Methods

Method Description
normalizeIndex ( $size, $index, &$normalized = null )

Method Details

__construct() public method

Construct a new cardinality verifier event collection.
public __construct ( array $events, CallVerifierFactory $callVerifierFactory )
$events array
$callVerifierFactory Eloquent\Phony\Call\CallVerifierFactory The call verifier factory to use.

allCalls() public method

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

allEvents() public method

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

always() public method

Requires that the next verification matches for all possible items.
public always ( )

atLeast() public method

Requires that the next verification matches a number of times greater than or equal to $minimum.
public atLeast ( integer $minimum )
$minimum integer The minimum match count.

atMost() public method

Requires that the next verification matches a number of times less than or equal to $maximum.
public atMost ( integer $maximum )
$maximum integer The maximum match count.

between() public method

Requires that the next verification matches a number of times greater than or equal to $minimum, and less than or equal to $maximum.
public between ( integer $minimum, integer | null $maximum )
$minimum integer The minimum match count.
$maximum integer | null The maximum match count, or null for no maximum.

callAt() public method

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.
return Eloquent\Phony\Call\Call The call.

callCount() public method

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

cardinality() public method

Get the cardinality.
public cardinality ( ) : Cardinality
return Cardinality The cardinality.

count() public method

Get the event count.
public count ( ) : integer
return integer The event count.

eventAt() public method

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.
return Eloquent\Phony\Event\Event The event.

eventCount() public method

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

firstCall() public method

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

firstEvent() public method

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

getIterator() public method

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

hasCalls() public method

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

hasEvents() public method

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

lastCall() public method

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

lastEvent() public method

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

never() public method

Requires that the next verification never matches.
public never ( )

once() public method

Requires that the next verification matches only once.
public once ( )

resetCardinality() public method

Reset the cardinality to its default value.
public resetCardinality ( ) : Cardinality
return Cardinality The current cardinality.

thrice() public method

Requires that the next verification matches exactly three times.
public thrice ( )

times() public method

Requires that the next verification matches an exact number of times.
public times ( integer $times )
$times integer The match count.

twice() public method

Requires that the next verification matches exactly two times.
public twice ( )

Property Details

$callCount protected_oe property

protected $callCount

$callVerifierFactory protected_oe property

protected $callVerifierFactory

$calls protected_oe property

protected $calls

$cardinality protected_oe property

protected $cardinality

$eventCount protected_oe property

protected $eventCount

$events protected_oe property

protected $events