Documentation

PHPUnit_Framework_MockObject_Matcher_InvokedCount extends PHPUnit_Framework_MockObject_Matcher_InvokedRecorder
in package

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.

Tags
since

Class available since Release 1.0.0

Table of Contents

$expectedCount  : int
$invocations  : array<string|int, PHPUnit_Framework_MockObject_Invocation>
__construct()  : mixed
getInvocationCount()  : int
getInvocations()  : array<string|int, PHPUnit_Framework_MockObject_Invocation>
hasBeenInvoked()  : bool
invoked()  : mixed
Registers the invocation $invocation in the object as being invoked.
isNever()  : bool
matches()  : bool
Checks if the invocation $invocation matches the current rules. If it does the matcher will get the invoked() method called which should check if an expectation is met.
toString()  : string
verify()  : mixed
Verifies that the current expectation is valid. If everything is OK the code should just return, if not it must throw an exception.

Properties

Methods

__construct()

public __construct(int $expectedCount) : mixed
Parameters
$expectedCount : int
Return values
mixed —

getInvocationCount()

public getInvocationCount() : int
Return values
int —

hasBeenInvoked()

public hasBeenInvoked() : bool
Return values
bool —

isNever()

public isNever() : bool
Return values
bool —

toString()

public toString() : string
Return values
string —

Search results