Lggr
All Classes Namespaces Functions Variables Pages
Public Member Functions | List of all members
PHPUnit\Framework\MockObject\Builder\InvocationMocker Class Reference
Inheritance diagram for PHPUnit\Framework\MockObject\Builder\InvocationMocker:
Inheritance graph
[legend]
Collaboration diagram for PHPUnit\Framework\MockObject\Builder\InvocationMocker:
Collaboration graph
[legend]

Public Member Functions

 __construct (MatcherCollection $collection, Invocation $invocationMatcher, array $configurableMethods)
 
 getMatcher ()
 
 id ($id)
 
 will (Stub $stub)
 
 willReturn ($value,... $nextValues)
 
 willReturnReference (&$reference)
 
 willReturnMap (array $valueMap)
 
 willReturnArgument ($argumentIndex)
 
 willReturnCallback ($callback)
 
 willReturnSelf ()
 
 willReturnOnConsecutiveCalls (... $values)
 
 willThrowException (\Exception $exception)
 
 after ($id)
 
 with (... $arguments)
 
 withConsecutive (... $arguments)
 
 withAnyParameters ()
 
 method ($constraint)
 
- Public Member Functions inherited from PHPUnit\Framework\MockObject\Builder\Stub
 will (BaseStub $stub)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __construct()

PHPUnit\Framework\MockObject\Builder\InvocationMocker::__construct ( MatcherCollection  $collection,
Invocation  $invocationMatcher,
array  $configurableMethods 
)
Parameters
MatcherCollection$collection
Invocation$invocationMatcher
array$configurableMethods

Member Function Documentation

◆ after()

PHPUnit\Framework\MockObject\Builder\InvocationMocker::after (   $id)
Parameters
mixed$id
Returns
InvocationMocker

Implements PHPUnit\Framework\MockObject\Builder\Match.

◆ getMatcher()

PHPUnit\Framework\MockObject\Builder\InvocationMocker::getMatcher ( )
Returns
Matcher

◆ id()

PHPUnit\Framework\MockObject\Builder\InvocationMocker::id (   $id)
Parameters
mixed$id
Returns
InvocationMocker

Implements PHPUnit\Framework\MockObject\Builder\Identity.

◆ method()

PHPUnit\Framework\MockObject\Builder\InvocationMocker::method (   $constraint)
Parameters
Constraint | string$constraint
Returns
InvocationMocker
Exceptions
RuntimeException

Implements PHPUnit\Framework\MockObject\Builder\MethodNameMatch.

◆ will()

PHPUnit\Framework\MockObject\Builder\InvocationMocker::will ( Stub  $stub)
Parameters
Stub$stub
Returns
InvocationMocker

◆ willReturn()

PHPUnit\Framework\MockObject\Builder\InvocationMocker::willReturn (   $value,
  $nextValues 
)
Parameters
mixed$value
mixed$nextValues,...
Returns
InvocationMocker

◆ willReturnArgument()

PHPUnit\Framework\MockObject\Builder\InvocationMocker::willReturnArgument (   $argumentIndex)
Parameters
mixed$argumentIndex
Returns
InvocationMocker

◆ willReturnCallback()

PHPUnit\Framework\MockObject\Builder\InvocationMocker::willReturnCallback (   $callback)
Parameters
callable$callback
Returns
InvocationMocker

◆ willReturnMap()

PHPUnit\Framework\MockObject\Builder\InvocationMocker::willReturnMap ( array  $valueMap)
Parameters
array$valueMap
Returns
InvocationMocker

◆ willReturnOnConsecutiveCalls()

PHPUnit\Framework\MockObject\Builder\InvocationMocker::willReturnOnConsecutiveCalls (   $values)
Parameters
mixed$values,...
Returns
InvocationMocker

◆ willReturnReference()

PHPUnit\Framework\MockObject\Builder\InvocationMocker::willReturnReference ( $reference)
Parameters
mixed$reference
Returns
InvocationMocker

◆ willReturnSelf()

PHPUnit\Framework\MockObject\Builder\InvocationMocker::willReturnSelf ( )

◆ willThrowException()

PHPUnit\Framework\MockObject\Builder\InvocationMocker::willThrowException ( \Exception  $exception)
Parameters
\Exception$exception
Returns
InvocationMocker

◆ with()

PHPUnit\Framework\MockObject\Builder\InvocationMocker::with (   $arguments)
Parameters
array...$arguments
Returns
InvocationMocker
Exceptions
RuntimeException

Implements PHPUnit\Framework\MockObject\Builder\ParametersMatch.

◆ withAnyParameters()

PHPUnit\Framework\MockObject\Builder\InvocationMocker::withAnyParameters ( )

◆ withConsecutive()

PHPUnit\Framework\MockObject\Builder\InvocationMocker::withConsecutive (   $arguments)
Parameters
array...$arguments
Returns
InvocationMocker
Exceptions
RuntimeException

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