PHPUnit_Framework_MockObject_Builder_MethodNameMatch
interface PHPUnit_Framework_MockObject_Builder_MethodNameMatch implements PHPUnit_Framework_MockObject_Builder_ParametersMatch (View source)
Builder interface for matcher of method names.
Methods
Sets the identification of the expectation to $id.
Stubs the matching method with the stub object $stub. Any invocations of the matched method will now be handled by the stub instead.
Defines the expectation which must occur before the current is valid.
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 PHPUnitFrameworkConstraint and use it for the parameter.
Sets a matcher which allows any kind of parameters.
Adds a new method name match and returns the parameter match object for further matching possibilities.
Details
id(string $id)
Sets the identification of the expectation to $id.
PHPUnit_Framework_MockObject_Builder_Identity
will(PHPUnit_Framework_MockObject_Stub $stub)
Stubs the matching method with the stub object $stub. Any invocations of the matched method will now be handled by the stub instead.
PHPUnit_Framework_MockObject_Builder_Stub
after(string $id)
Defines the expectation which must occur before the current is valid.
PHPUnit_Framework_MockObject_Builder_ParametersMatch
with($arguments)
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 PHPUnitFrameworkConstraint and use it for the parameter.
If the parameter value is not a constraint it will use the PHPUnitFrameworkConstraint_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 PHPUnitFrameworkConstraint_IsEqual(42));
PHPUnit_Framework_MockObject_Matcher_AnyParameters
withAnyParameters()
Sets a matcher which allows any kind of parameters.
Some examples:
// match any number of parameters
$b->withAnyParameters();
at line 24
PHPUnit_Framework_MockObject_Builder_ParametersMatch
method(PHPUnit_Framework_Constraint $name)
Adds a new method name match and returns the parameter match object for further matching possibilities.