Documentation

ObjectProphecy
in package
implements ProphecyInterface

Object prophecy.

Tags
author

Konstantin Kudryashov ever.zet@gmail.com

Interfaces, Classes and Traits

ProphecyInterface
Core Prophecy interface.

Table of Contents

$callCenter  : mixed
$comparatorFactory  : mixed
$lazyDouble  : mixed
$methodProphecies  : array<string|int, array<string|int, MethodProphecy>>
$revealer  : mixed
__call()  : MethodProphecy
Creates new method prophecy using specified method name and arguments.
__construct()  : mixed
Initializes object prophecy.
__get()  : mixed
Tries to get property value from double.
__set()  : mixed
Tries to set property value to double.
addMethodProphecy()  : mixed
Adds method prophecy to object prophecy.
checkProphecyMethodsPredictions()  : mixed
Checks that registered method predictions do not fail.
findProphecyMethodCalls()  : array<string|int, Call>
Finds calls by method name & arguments wildcard.
getMethodProphecies()  : array<string|int, MethodProphecy>
Returns either all or related to single method prophecies.
makeProphecyMethodCall()  : mixed
Makes specific method call.
reveal()  : object
Reveals double.
willBeConstructedWith()  : $this
Sets constructor arguments.
willExtend()  : $this
Forces double to extend specific class.
willImplement()  : $this
Forces double to implement specific interface.

Properties

Methods

__call()

Creates new method prophecy using specified method name and arguments.

public __call(string $methodName, array<string|int, mixed> $arguments) : MethodProphecy
Parameters
$methodName : string
$arguments : array<string|int, mixed>
Return values
MethodProphecy

__get()

Tries to get property value from double.

public __get(string $name) : mixed
Parameters
$name : string
Return values
mixed

__set()

Tries to set property value to double.

public __set(string $name, mixed $value) : mixed
Parameters
$name : string
$value : mixed
Return values
mixed

findProphecyMethodCalls()

Finds calls by method name & arguments wildcard.

public findProphecyMethodCalls(string $methodName, ArgumentsWildcard $wildcard) : array<string|int, Call>
Parameters
$methodName : string
$wildcard : ArgumentsWildcard
Return values
array<string|int, Call>

getMethodProphecies()

Returns either all or related to single method prophecies.

public getMethodProphecies([null|string $methodName = null ]) : array<string|int, MethodProphecy>
Parameters
$methodName : null|string = null
Return values
array<string|int, MethodProphecy>

makeProphecyMethodCall()

Makes specific method call.

public makeProphecyMethodCall(string $methodName, array<string|int, mixed> $arguments) : mixed
Parameters
$methodName : string
$arguments : array<string|int, mixed>
Return values
mixed

willBeConstructedWith()

Sets constructor arguments.

public willBeConstructedWith([array<string|int, mixed> $arguments = null ]) : $this
Parameters
$arguments : array<string|int, mixed> = null
Return values
$this

willExtend()

Forces double to extend specific class.

public willExtend(string $class) : $this
Parameters
$class : string
Return values
$this

willImplement()

Forces double to implement specific interface.

public willImplement(string $interface) : $this
Parameters
$interface : string
Return values
$this

Search results