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
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
$expectedCount
protected
int
$expectedCount
$invocations
protected
array<string|int, PHPUnit_Framework_MockObject_Invocation>
$invocations
= array()
Methods
__construct()
public
__construct(int $expectedCount) : mixed
Parameters
- $expectedCount : int
Return values
mixed —getInvocationCount()
public
getInvocationCount() : int
Return values
int —getInvocations()
public
getInvocations() : array<string|int, PHPUnit_Framework_MockObject_Invocation>
Return values
array<string|int, PHPUnit_Framework_MockObject_Invocation> —hasBeenInvoked()
public
hasBeenInvoked() : bool
Return values
bool —invoked()
Registers the invocation $invocation in the object as being invoked.
public
invoked(PHPUnit_Framework_MockObject_Invocation $invocation) : mixed
Parameters
- $invocation : PHPUnit_Framework_MockObject_Invocation
Tags
Return values
mixed —isNever()
public
isNever() : bool
Return values
bool —matches()
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.
public
matches(PHPUnit_Framework_MockObject_Invocation $invocation) : bool
Parameters
- $invocation : PHPUnit_Framework_MockObject_Invocation
Return values
bool —toString()
public
toString() : string
Return values
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.
public
verify() : mixed