class PHPUnit_Framework_MockObject_Matcher_InvokedCount extends PHPUnit_Framework_MockObject_Matcher_InvokedRecorder (View source)

Invocation matcher which checks if a method has been invoked a certain amount of times.

If the number of invocations exceeds the value it will immediately throw an exception, If the number is less it will later be checked in verify() and also throw an exception.

Properties

protected PHPUnit_Framework_MockObject_Invocation[] $invocations from PHPUnit_Framework_MockObject_Matcher_InvokedRecorder
protected int $expectedCount

Methods

mixed
invoked(PHPUnit_Framework_MockObject_Invocation $invocation)

No description

__construct(int $expectedCount)

No description

bool
isNever()

No description

string
toString()

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

int getInvocationCount()

Return Value

int

bool hasBeenInvoked()

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

Exceptions

ExpectationFailedException

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

__construct(int $expectedCount)

Parameters

int $expectedCount

bool isNever()

Return Value

bool

string toString()

Return Value

string

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