PHPUnit_Framework_MockObject_InvocationMocker
in package
implements
PHPUnit_Framework_MockObject_Stub_MatcherCollection, PHPUnit_Framework_MockObject_Invokable, PHPUnit_Framework_MockObject_Builder_Namespace
Mocker for invocations which are sent from PHPUnit_Framework_MockObject_MockObject objects.
Keeps track of all expectations and stubs as well as registering identifications for builders.
Tags
Interfaces, Classes and Traits
- PHPUnit_Framework_MockObject_Stub_MatcherCollection
- Stubs a method by returning a user-defined value.
- PHPUnit_Framework_MockObject_Invokable
- Interface for classes which can be invoked.
- PHPUnit_Framework_MockObject_Builder_Namespace
- Interface for builders which can register builders with a given identification.
Table of Contents
- $builderMap : array<string|int, PHPUnit_Framework_MockObject_Builder_Match>
- $matchers : array<string|int, PHPUnit_Framework_MockObject_Matcher_Invocation>
- addMatcher() : mixed
- Adds a new matcher to the collection which can be used as an expectation or a stub.
- expects() : PHPUnit_Framework_MockObject_Builder_InvocationMocker
- hasMatchers() : mixed
- invoke() : mixed
- Invokes the invocation object $invocation so that it can be checked for expectations or matched against stubs.
- lookupId() : bool|null
- Looks up the match builder with identification $id and returns it.
- matches() : bool
- Checks if the invocation matches.
- registerId() : mixed
- Registers the match builder $builder with the identification $id. The builder can later be looked up using lookupId() to figure out if it has been invoked.
- verify() : bool
Properties
$builderMap
protected
array<string|int, PHPUnit_Framework_MockObject_Builder_Match>
$builderMap
= array()
$matchers
protected
array<string|int, PHPUnit_Framework_MockObject_Matcher_Invocation>
$matchers
= array()
Methods
addMatcher()
Adds a new matcher to the collection which can be used as an expectation or a stub.
public
addMatcher(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) : mixed
Parameters
Return values
mixed —expects()
public
expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) : PHPUnit_Framework_MockObject_Builder_InvocationMocker
Parameters
Return values
PHPUnit_Framework_MockObject_Builder_InvocationMocker —hasMatchers()
public
hasMatchers() : mixed
Tags
Return values
mixed —invoke()
Invokes the invocation object $invocation so that it can be checked for expectations or matched against stubs.
public
invoke(PHPUnit_Framework_MockObject_Invocation $invocation) : mixed
Parameters
- $invocation : PHPUnit_Framework_MockObject_Invocation
Return values
mixed —lookupId()
Looks up the match builder with identification $id and returns it.
public
lookupId(mixed $id) : bool|null
Parameters
- $id : mixed
Return values
bool|null —matches()
Checks if the invocation matches.
public
matches(PHPUnit_Framework_MockObject_Invocation $invocation) : bool
Parameters
- $invocation : PHPUnit_Framework_MockObject_Invocation
Return values
bool —registerId()
Registers the match builder $builder with the identification $id. The builder can later be looked up using lookupId() to figure out if it has been invoked.
public
registerId(mixed $id, PHPUnit_Framework_MockObject_Builder_Match $builder) : mixed
Parameters
- $id : mixed
- $builder : PHPUnit_Framework_MockObject_Builder_Match
Tags
Return values
mixed —verify()
public
verify() : bool