ObjectProphecy
in package
implements
ProphecyInterface
Object prophecy.
Tags
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
$callCenter
private
mixed
$callCenter
$comparatorFactory
private
mixed
$comparatorFactory
$lazyDouble
private
mixed
$lazyDouble
$methodProphecies
private
array<string|int, array<string|int, MethodProphecy>>
$methodProphecies
= array()
$revealer
private
mixed
$revealer
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 —__construct()
Initializes object prophecy.
public
__construct(LazyDouble $lazyDouble[, CallCenter $callCenter = null ][, RevealerInterface $revealer = null ][, Factory $comparatorFactory = null ]) : mixed
Parameters
- $lazyDouble : LazyDouble
- $callCenter : CallCenter = null
- $revealer : RevealerInterface = null
- $comparatorFactory : Factory = null
Return values
mixed —__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 —addMethodProphecy()
Adds method prophecy to object prophecy.
public
addMethodProphecy(MethodProphecy $methodProphecy) : mixed
Parameters
- $methodProphecy : MethodProphecy
Tags
Return values
mixed —checkProphecyMethodsPredictions()
Checks that registered method predictions do not fail.
public
checkProphecyMethodsPredictions() : mixed
Tags
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 —reveal()
Reveals double.
public
reveal() : object
Tags
Return values
object —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