PHPUnit_Framework_MockObject_Matcher_ConsecutiveParameters
extends PHPUnit_Framework_MockObject_Matcher_StatelessInvocation
in package
Invocation matcher which looks for sets of specific parameters in the invocations.
Checks the parameters of the incoming invocations, the parameter list is checked against the defined constraints in $parameters. If the constraint is met it will return true in matches().
It takes a list of match groups and and increases a call index after each invocation. So the first invocation uses the first group of constraints, the second the next and so on.
Table of Contents
- $_invocations : array<string|int, mixed>
- $_parameterGroups : array<string|int, mixed>
- __construct() : mixed
- invoked() : mixed
- Registers the invocation $invocation in the object as being invoked.
- matches() : bool
- toString() : string
- verify() : 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.
- verifyInvocation() : mixed
- Verify a single invocation
Properties
$_invocations
private
array<string|int, mixed>
$_invocations
= array()
$_parameterGroups
private
array<string|int, mixed>
$_parameterGroups
= array()
Methods
__construct()
public
__construct(array<string|int, mixed> $parameterGroups) : mixed
Parameters
- $parameterGroups : array<string|int, mixed>
Return values
mixed —invoked()
Registers the invocation $invocation in the object as being invoked.
public
invoked(PHPUnit_Framework_MockObject_Invocation $invocation) : mixed
This will only occur after matches() returns true which means the current invocation is the correct one.
The matcher can store information from the invocation which can later be checked in verify(), or it can check the values directly and throw and exception if an expectation is not met.
If the matcher is a stub it will also have a return value.
Parameters
- $invocation : PHPUnit_Framework_MockObject_Invocation
-
Object containing information on a mocked or stubbed method which was invoked.
Return values
mixed —matches()
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()
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
verify() : bool
Return values
bool —verifyInvocation()
Verify a single invocation
private
verifyInvocation(PHPUnit_Framework_MockObject_Invocation $invocation, int $callIndex) : mixed
Parameters
- $invocation : PHPUnit_Framework_MockObject_Invocation
- $callIndex : int