class PHPUnit_Framework_MockObject_Builder_InvocationMocker implements PHPUnit_Framework_MockObject_Builder_MethodNameMatch (View source)

Builder for mocked or stubbed invocations.

Provides methods for building expectations without having to resort to instantiating the various matchers manually. These methods also form a more natural way of reading the expectation. This class should be together with the test case PHPUnitFrameworkMockObject_TestCase.

Properties

protected PHPUnit_Framework_MockObject_Stub_MatcherCollection $collection
protected PHPUnit_Framework_MockObject_Matcher $matcher

Methods

__construct(PHPUnit_Framework_MockObject_Stub_MatcherCollection $collection, PHPUnit_Framework_MockObject_Matcher_Invocation $invocationMatcher, array $configurableMethods)

No description

id(string $id)

No description

method(PHPUnit_Framework_Constraint|string $constraint)

No description

Details

__construct(PHPUnit_Framework_MockObject_Stub_MatcherCollection $collection, PHPUnit_Framework_MockObject_Matcher_Invocation $invocationMatcher, array $configurableMethods)

Parameters

PHPUnit_Framework_MockObject_Stub_MatcherCollection $collection
PHPUnit_Framework_MockObject_Matcher_Invocation $invocationMatcher
array $configurableMethods

id(string $id)

Parameters

string $id Unique identification of expectation.

PHPUnit_Framework_MockObject_Builder_InvocationMocker willReturn($value, $nextValues)

Parameters

$value
$nextValues

Return Value

PHPUnit_Framework_MockObject_Builder_InvocationMocker

PHPUnit_Framework_MockObject_Builder_InvocationMocker willReturnReference(mixed $reference)

Parameters

mixed $reference

Return Value

PHPUnit_Framework_MockObject_Builder_InvocationMocker

PHPUnit_Framework_MockObject_Builder_InvocationMocker willReturnMap(array $valueMap)

Parameters

array $valueMap

Return Value

PHPUnit_Framework_MockObject_Builder_InvocationMocker

PHPUnit_Framework_MockObject_Builder_InvocationMocker willReturnArgument(mixed $argumentIndex)

Parameters

mixed $argumentIndex

Return Value

PHPUnit_Framework_MockObject_Builder_InvocationMocker

PHPUnit_Framework_MockObject_Builder_InvocationMocker willReturnCallback(callable $callback)

Parameters

callable $callback

Return Value

PHPUnit_Framework_MockObject_Builder_InvocationMocker

PHPUnit_Framework_MockObject_Builder_InvocationMocker willReturnOnConsecutiveCalls($values)

PHPUnit_Framework_MockObject_Builder_Stub after(string $id)

Parameters

string $id The identification of the expectation that should occur before this one.

Return Value

PHPUnit_Framework_MockObject_Builder_Stub

PHPUnit_Framework_MockObject_Builder_InvocationMocker withConsecutive(array $arguments)

Parameters

array $arguments

Return Value

PHPUnit_Framework_MockObject_Builder_InvocationMocker

PHPUnit_Framework_MockObject_Builder_ParametersMatch method(PHPUnit_Framework_Constraint|string $constraint)

Parameters

PHPUnit_Framework_Constraint|string $constraint

Return Value

PHPUnit_Framework_MockObject_Builder_ParametersMatch