PHPUnit_Framework_MockObject_Builder_ParametersMatch
extends
PHPUnit_Framework_MockObject_Builder_Match
in
Builder interface for parameter matchers.
Tags
Table of Contents
- after() : PHPUnit_Framework_MockObject_Builder_Stub
- Defines the expectation which must occur before the current is valid.
- id() : mixed
- Sets the identification of the expectation to $id.
- will() : PHPUnit_Framework_MockObject_Builder_Identity
- Stubs the matching method with the stub object $stub. Any invocations of the matched method will now be handled by the stub instead.
- with() : PHPUnit_Framework_MockObject_Builder_ParametersMatch
- Sets the parameters to match for, each parameter to this funtion will be part of match. To perform specific matches or constraints create a new PHPUnit_Framework_Constraint and use it for the parameter.
- withAnyParameters() : PHPUnit_Framework_MockObject_Matcher_AnyParameters
- Sets a matcher which allows any kind of parameters.
Methods
after()
Defines the expectation which must occur before the current is valid.
public
after(string $id) : PHPUnit_Framework_MockObject_Builder_Stub
Parameters
- $id : string
-
The identification of the expectation that should occur before this one.
Return values
PHPUnit_Framework_MockObject_Builder_Stub —id()
Sets the identification of the expectation to $id.
public
id(string $id) : mixed
Parameters
- $id : string
-
Unique identifiation of expectation.
Tags
Return values
mixed —will()
Stubs the matching method with the stub object $stub. Any invocations of the matched method will now be handled by the stub instead.
public
will(PHPUnit_Framework_MockObject_Stub $stub) : PHPUnit_Framework_MockObject_Builder_Identity
Parameters
- $stub : PHPUnit_Framework_MockObject_Stub
-
The stub object.
Return values
PHPUnit_Framework_MockObject_Builder_Identity —with()
Sets the parameters to match for, each parameter to this funtion will be part of match. To perform specific matches or constraints create a new PHPUnit_Framework_Constraint and use it for the parameter.
public
with() : PHPUnit_Framework_MockObject_Builder_ParametersMatch
If the parameter value is not a constraint it will use the PHPUnit_Framework_Constraint_IsEqual for the value.
Some examples:
// match first parameter with value 2
$b->with(2);
// match first parameter with value 'smock' and second identical to 42
$b->with('smock', new PHPUnit_Framework_Constraint_IsEqual(42));
Return values
PHPUnit_Framework_MockObject_Builder_ParametersMatch —withAnyParameters()
Sets a matcher which allows any kind of parameters.
public
withAnyParameters() : PHPUnit_Framework_MockObject_Matcher_AnyParameters
Some examples:
// match any number of parameters
$b->withAnyParamers();