Documentation

InvocationMocker
in package
implements InvocationStubber, MethodNameMatch

FinalYes
Tags
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

Table of Contents

Interfaces

InvocationStubber
MethodNameMatch

Properties

$configurableMethods  : array<string|int, ConfigurableMethod>
$invocationHandler  : InvocationHandler
$matcher  : Matcher

Methods

__construct()  : mixed
after()  : $this
id()  : $this
method()  : $this
will()  : $this
willReturn()  : self
willReturnArgument()  : self
willReturnCallback()  : self
willReturnMap()  : self
willReturnOnConsecutiveCalls()  : self
willReturnReference()  : self
willReturnSelf()  : self
willThrowException()  : self
with()  : $this
withAnyParameters()  : $this
withConsecutive()  : $this
ensureParametersCanBeConfigured()  : void
ensureTypeOfReturnValues()  : void
getConfiguredMethod()  : ConfigurableMethod|null

Properties

$configurableMethods

private array<string|int, ConfigurableMethod> $configurableMethods

Methods

__construct()

public __construct(InvocationHandler $handler, Matcher $matcher, ConfigurableMethod ...$configurableMethods) : mixed
Parameters
$handler : InvocationHandler
$matcher : Matcher
$configurableMethods : ConfigurableMethod

after()

public after(mixed $id) : $this
Parameters
$id : mixed
Return values
$this

id()

public id(mixed $id) : $this
Parameters
$id : mixed
Tags
throws
MatcherAlreadyRegisteredException
Return values
$this

method()

public method(Constraint|string $constraint) : $this
Parameters
$constraint : Constraint|string
Tags
throws
InvalidArgumentException
throws
MethodCannotBeConfiguredException
throws
MethodNameAlreadyConfiguredException
Return values
$this

will()

public will(Stub $stub) : $this
Parameters
$stub : Stub
Return values
$this

willReturn()

public willReturn(mixed $value, array<string|int, mixed> ...$nextValues) : self
Parameters
$value : mixed
$nextValues : array<string|int, mixed>
Tags
throws
IncompatibleReturnValueException
Return values
self

willReturnArgument()

public willReturnArgument(mixed $argumentIndex) : self
Parameters
$argumentIndex : mixed
Return values
self

willReturnCallback()

public willReturnCallback(mixed $callback) : self
Parameters
$callback : mixed
Return values
self

willReturnMap()

public willReturnMap(array<string|int, mixed> $valueMap) : self
Parameters
$valueMap : array<string|int, mixed>
Return values
self

willReturnOnConsecutiveCalls()

public willReturnOnConsecutiveCalls(mixed ...$values) : self
Parameters
$values : mixed
Return values
self

willReturnReference()

public willReturnReference(mixed &$reference) : self
Parameters
$reference : mixed
Return values
self

willThrowException()

public willThrowException(Throwable $exception) : self
Parameters
$exception : Throwable
Return values
self

with()

public with(array<string|int, mixed> ...$arguments) : $this
Parameters
$arguments : array<string|int, mixed>
Tags
throws
Exception
throws
MethodNameNotConfiguredException
throws
MethodParametersAlreadyConfiguredException
Return values
$this

withAnyParameters()

public withAnyParameters() : $this
Tags
throws
MethodNameNotConfiguredException
throws
MethodParametersAlreadyConfiguredException
Return values
$this

withConsecutive()

public withConsecutive(array<string|int, mixed> ...$arguments) : $this
Parameters
$arguments : array<string|int, mixed>
Tags
throws
Exception
throws
MethodNameNotConfiguredException
throws
MethodParametersAlreadyConfiguredException
Return values
$this

ensureParametersCanBeConfigured()

private ensureParametersCanBeConfigured() : void
Tags
throws
MethodNameNotConfiguredException
throws
MethodParametersAlreadyConfiguredException

ensureTypeOfReturnValues()

private ensureTypeOfReturnValues(array<string|int, mixed> $values) : void
Parameters
$values : array<string|int, mixed>
Tags
throws
IncompatibleReturnValueException

getConfiguredMethod()

private getConfiguredMethod() : ConfigurableMethod|null
Return values
ConfigurableMethod|null

        
On this page

Search results