class PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex implements PHPUnit_Framework_MockObject_Matcher_Invocation (View source)

Invocation matcher which checks if a method was invoked at a certain index.

If the expected index number does not match the current invocation index it will not match which means it skips all method and parameter matching. Only once the index is reached will the method and parameter start matching and verifying.

If the index is never reached it will throw an exception in index.

Properties

protected int $sequenceIndex
protected int $currentIndex

Methods

__construct(int $sequenceIndex)

No description

string
toString()

No description

bool
matches(PHPUnit_Framework_MockObject_Invocation $invocation)

No description

mixed
invoked(PHPUnit_Framework_MockObject_Invocation $invocation)

No description

verify()

Verifies that the current expectation is valid. If everything is OK the code should just return, if not it must throw an exception.

Details

__construct(int $sequenceIndex)

Parameters

int $sequenceIndex

string toString()

Return Value

string

bool matches(PHPUnit_Framework_MockObject_Invocation $invocation)

Parameters

PHPUnit_Framework_MockObject_Invocation $invocation Object containing information on a mocked or stubbed method which was invoked

Return Value

bool

mixed invoked(PHPUnit_Framework_MockObject_Invocation $invocation)

Parameters

PHPUnit_Framework_MockObject_Invocation $invocation Object containing information on a mocked or stubbed method which was invoked

Return Value

mixed

verify()

Verifies that the current expectation is valid. If everything is OK the code should just return, if not it must throw an exception.

Exceptions

ExpectationFailedException