PHPUnit_Framework_MockObject_Builder_InvocationMocker
in package
implements
PHPUnit_Framework_MockObject_Builder_MethodNameMatch
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 PHPUnit_Framework_MockObject_TestCase.
Tags
Interfaces, Classes and Traits
- PHPUnit_Framework_MockObject_Builder_MethodNameMatch
- Builder interface for matcher of method names.
Table of Contents
- $collection : PHPUnit_Framework_MockObject_Stub_MatcherCollection
- $matcher : PHPUnit_Framework_MockObject_Matcher
- __construct() : mixed
- after() : PHPUnit_Framework_MockObject_Builder_InvocationMocker
- getMatcher() : PHPUnit_Framework_MockObject_Matcher
- id() : PHPUnit_Framework_MockObject_Builder_InvocationMocker
- method() : PHPUnit_Framework_MockObject_Builder_InvocationMocker
- Adds a new method name match and returns the parameter match object for further matching possibilities.
- will() : PHPUnit_Framework_MockObject_Builder_InvocationMocker
- willReturn() : PHPUnit_Framework_MockObject_Builder_InvocationMocker
- willReturnArgument() : PHPUnit_Framework_MockObject_Builder_InvocationMocker
- willReturnCallback() : PHPUnit_Framework_MockObject_Builder_InvocationMocker
- willReturnMap() : PHPUnit_Framework_MockObject_Builder_InvocationMocker
- willReturnOnConsecutiveCalls() : PHPUnit_Framework_MockObject_Builder_InvocationMocker
- willReturnSelf() : PHPUnit_Framework_MockObject_Builder_InvocationMocker
- willThrowException() : PHPUnit_Framework_MockObject_Builder_InvocationMocker
- with() : PHPUnit_Framework_MockObject_Builder_InvocationMocker
- withAnyParameters() : PHPUnit_Framework_MockObject_Builder_InvocationMocker
- withConsecutive() : PHPUnit_Framework_MockObject_Builder_InvocationMocker
- canDefineParameters() : mixed
- Validate that a parameters matcher can be defined, throw exceptions otherwise.
Properties
$collection
protected
PHPUnit_Framework_MockObject_Stub_MatcherCollection
$collection
$matcher
protected
PHPUnit_Framework_MockObject_Matcher
$matcher
Methods
__construct()
public
__construct(PHPUnit_Framework_MockObject_Stub_MatcherCollection $collection, PHPUnit_Framework_MockObject_Matcher_Invocation $invocationMatcher) : mixed
Parameters
- $collection : PHPUnit_Framework_MockObject_Stub_MatcherCollection
- $invocationMatcher : PHPUnit_Framework_MockObject_Matcher_Invocation
Return values
mixed —after()
public
after(mixed $id) : PHPUnit_Framework_MockObject_Builder_InvocationMocker
Parameters
- $id : mixed
Return values
PHPUnit_Framework_MockObject_Builder_InvocationMocker —getMatcher()
public
getMatcher() : PHPUnit_Framework_MockObject_Matcher
Return values
PHPUnit_Framework_MockObject_Matcher —id()
public
id(mixed $id) : PHPUnit_Framework_MockObject_Builder_InvocationMocker
Parameters
- $id : mixed
Return values
PHPUnit_Framework_MockObject_Builder_InvocationMocker —method()
Adds a new method name match and returns the parameter match object for further matching possibilities.
public
method(PHPUnit_Framework_Constraint|string $constraint) : PHPUnit_Framework_MockObject_Builder_InvocationMocker
Parameters
- $constraint : PHPUnit_Framework_Constraint|string
Return values
PHPUnit_Framework_MockObject_Builder_InvocationMocker —will()
public
will(PHPUnit_Framework_MockObject_Stub $stub) : PHPUnit_Framework_MockObject_Builder_InvocationMocker
Parameters
Return values
PHPUnit_Framework_MockObject_Builder_InvocationMocker —willReturn()
public
willReturn(mixed $value) : PHPUnit_Framework_MockObject_Builder_InvocationMocker
Parameters
- $value : mixed
Return values
PHPUnit_Framework_MockObject_Builder_InvocationMocker —willReturnArgument()
public
willReturnArgument(mixed $argumentIndex) : PHPUnit_Framework_MockObject_Builder_InvocationMocker
Parameters
- $argumentIndex : mixed
Return values
PHPUnit_Framework_MockObject_Builder_InvocationMocker —willReturnCallback()
public
willReturnCallback(callable $callback) : PHPUnit_Framework_MockObject_Builder_InvocationMocker
Parameters
- $callback : callable
Return values
PHPUnit_Framework_MockObject_Builder_InvocationMocker —willReturnMap()
public
willReturnMap(array<string|int, mixed> $valueMap) : PHPUnit_Framework_MockObject_Builder_InvocationMocker
Parameters
- $valueMap : array<string|int, mixed>
Return values
PHPUnit_Framework_MockObject_Builder_InvocationMocker —willReturnOnConsecutiveCalls()
public
willReturnOnConsecutiveCalls() : PHPUnit_Framework_MockObject_Builder_InvocationMocker
Return values
PHPUnit_Framework_MockObject_Builder_InvocationMocker —willReturnSelf()
public
willReturnSelf() : PHPUnit_Framework_MockObject_Builder_InvocationMocker
Return values
PHPUnit_Framework_MockObject_Builder_InvocationMocker —willThrowException()
public
willThrowException(Exception $exception) : PHPUnit_Framework_MockObject_Builder_InvocationMocker
Parameters
- $exception : Exception
Return values
PHPUnit_Framework_MockObject_Builder_InvocationMocker —with()
public
with() : PHPUnit_Framework_MockObject_Builder_InvocationMocker
Return values
PHPUnit_Framework_MockObject_Builder_InvocationMocker —withAnyParameters()
public
withAnyParameters() : PHPUnit_Framework_MockObject_Builder_InvocationMocker
Return values
PHPUnit_Framework_MockObject_Builder_InvocationMocker —withConsecutive()
public
withConsecutive() : PHPUnit_Framework_MockObject_Builder_InvocationMocker
Return values
PHPUnit_Framework_MockObject_Builder_InvocationMocker —canDefineParameters()
Validate that a parameters matcher can be defined, throw exceptions otherwise.
private
canDefineParameters() : mixed