Documentation

MethodProphecy
in package

Method prophecy.

Tags
author

Konstantin Kudryashov ever.zet@gmail.com

Table of Contents

$argumentsWildcard  : mixed
$bound  : mixed
$checkedPredictions  : mixed
$methodName  : mixed
$objectProphecy  : mixed
$prediction  : mixed
$promise  : mixed
$voidReturnType  : mixed
__construct()  : mixed
Initializes method prophecy.
checkPrediction()  : mixed
Checks currently registered [with should(...)] prediction.
getArgumentsWildcard()  : ArgumentsWildcard
Returns arguments wildcard.
getCheckedPredictions()  : array<string|int, PredictionInterface>
Returns predictions that were checked on this object.
getMethodName()  : string
Returns method name.
getObjectProphecy()  : ObjectProphecy
Returns object prophecy this method prophecy is tied to.
getPrediction()  : null|PredictionInterface
Returns currently registered prediction.
getPromise()  : null|PromiseInterface
Returns currently registered promise.
hasReturnVoid()  : bool
should()  : $this
Sets custom prediction to the prophecy.
shouldBeCalled()  : $this
Sets call prediction to the prophecy.
shouldBeCalledOnce()  : $this
Sets call times prediction to the prophecy.
shouldBeCalledTimes()  : $this
Sets call times prediction to the prophecy.
shouldHave()  : $this
Checks provided prediction immediately.
shouldHaveBeenCalled()  : $this
Checks call prediction.
shouldHaveBeenCalledOnce()  : $this
Checks call times prediction.
shouldHaveBeenCalledTimes()  : $this
Checks call times prediction.
shouldNotBeCalled()  : $this
Sets no calls prediction to the prophecy.
shouldNotBeenCalled()  : $this
Checks no calls prediction.
shouldNotHaveBeenCalled()  : $this
Checks no calls prediction.
will()  : $this
Sets custom promise to the prophecy.
willReturn()  : $this
Sets return promise to the prophecy.
willReturnArgument()  : $this
Sets return argument promise to the prophecy.
willThrow()  : $this
Sets throw promise to the prophecy.
willYield()  : $this
withArguments()  : $this
Sets argument wildcard.
bindToObjectProphecy()  : mixed

Properties

Methods

checkPrediction()

Checks currently registered [with should(...)] prediction.

public checkPrediction() : mixed
Return values
mixed

getMethodName()

Returns method name.

public getMethodName() : string
Return values
string

hasReturnVoid()

public hasReturnVoid() : bool
Return values
bool

shouldBeCalled()

Sets call prediction to the prophecy.

public shouldBeCalled() : $this
Tags
see
CallPrediction
Return values
$this

shouldBeCalledTimes()

Sets call times prediction to the prophecy.

public shouldBeCalledTimes( $count) : $this
Parameters
$count :
Tags
see
CallTimesPrediction
Return values
$this

shouldHaveBeenCalledTimes()

Checks call times prediction.

public shouldHaveBeenCalledTimes(int $count) : $this
Parameters
$count : int
Tags
see
CallTimesPrediction
Return values
$this

shouldNotBeenCalled()

Checks no calls prediction.

public shouldNotBeenCalled() : $this
Tags
see
NoCallsPrediction
deprecated
Return values
$this

willReturnArgument()

Sets return argument promise to the prophecy.

public willReturnArgument([int $index = 0 ]) : $this
Parameters
$index : int = 0

The zero-indexed number of the argument to return

Tags
see
ReturnArgumentPromise
Return values
$this

willThrow()

Sets throw promise to the prophecy.

public willThrow(string|Exception $exception) : $this
Parameters
$exception : string|Exception

Exception class or instance

Tags
see
ThrowPromise
Return values
$this

willYield()

public willYield(array<string|int, mixed> $items[, mixed $return = null ]) : $this
Parameters
$items : array<string|int, mixed>
$return : mixed = null
Tags
throws
InvalidArgumentException
Return values
$this

bindToObjectProphecy()

private bindToObjectProphecy() : mixed
Return values
mixed

Search results