Lggr
Public Member Functions | List of all members
PHPUnit\Framework\MockObject\Matcher\Invocation Interface Reference
Inheritance diagram for PHPUnit\Framework\MockObject\Matcher\Invocation:
Inheritance graph
[legend]
Collaboration diagram for PHPUnit\Framework\MockObject\Matcher\Invocation:
Collaboration graph
[legend]

Public Member Functions

 invoked (BaseInvocation $invocation)
 
 matches (BaseInvocation $invocation)
 
- Public Member Functions inherited from PHPUnit\Framework\SelfDescribing
 toString ()
 
- Public Member Functions inherited from PHPUnit\Framework\MockObject\Verifiable
 verify ()
 

Detailed Description

Interface for classes which matches an invocation based on its method name, argument, order or call count.

Member Function Documentation

◆ invoked()

PHPUnit\Framework\MockObject\Matcher\Invocation::invoked ( BaseInvocation  $invocation)

Registers the invocation $invocation in the object as being invoked. This will only occur after matches() returns true which means the current invocation is the correct one.

The matcher can store information from the invocation which can later be checked in verify(), or it can check the values directly and throw and exception if an expectation is not met.

If the matcher is a stub it will also have a return value.

Parameters
BaseInvocation$invocationObject containing information on a mocked or stubbed method which was invoked
Returns
mixed

Implemented in PHPUnit\Framework\MockObject\Matcher\InvokedAtIndex, PHPUnit\Framework\MockObject\Matcher\InvokedCount, PHPUnit\Framework\MockObject\Matcher\InvokedRecorder, and PHPUnit\Framework\MockObject\Matcher\StatelessInvocation.

◆ matches()

PHPUnit\Framework\MockObject\Matcher\Invocation::matches ( BaseInvocation  $invocation)

Checks if the invocation $invocation matches the current rules. If it does the matcher will get the invoked() method called which should check if an expectation is met.

Parameters
BaseInvocation$invocationObject containing information on a mocked or stubbed method which was invoked
Returns
bool

Implemented in PHPUnit\Framework\MockObject\Matcher\Parameters, PHPUnit\Framework\MockObject\Matcher\ConsecutiveParameters, PHPUnit\Framework\MockObject\Matcher\MethodName, PHPUnit\Framework\MockObject\Matcher\InvokedRecorder, PHPUnit\Framework\MockObject\Matcher\InvokedAtIndex, and PHPUnit\Framework\MockObject\Matcher\AnyParameters.


The documentation for this interface was generated from the following file: