Documentation

CallCenter
in package

Calls receiver & manager.

Tags
author

Konstantin Kudryashov ever.zet@gmail.com

Table of Contents

$recordedCalls  : array<string|int, Call>
$unexpectedCalls  : SplObjectStorage
$util  : mixed
__construct()  : mixed
Initializes call center.
checkUnexpectedCalls()  : mixed
findCalls()  : array<string|int, Call>
Searches for calls by method name & arguments wildcard.
makeCall()  : mixed
Makes and records specific method call for object prophecy.
createUnexpectedCallException()  : mixed
findMethodProphecies()  : array<string|int, mixed>
indentArguments()  : mixed

Properties

$recordedCalls

private array<string|int, Call> $recordedCalls = array()

$unexpectedCalls

private SplObjectStorage $unexpectedCalls

Methods

__construct()

Initializes call center.

public __construct([StringUtil $util = null ]) : mixed
Parameters
$util : StringUtil = null
Return values
mixed

findCalls()

Searches for calls by method name & arguments wildcard.

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

makeCall()

Makes and records specific method call for object prophecy.

public makeCall(ObjectProphecy $prophecy, string $methodName, array<string|int, mixed> $arguments) : mixed
Parameters
$prophecy : ObjectProphecy
$methodName : string
$arguments : array<string|int, mixed>
Tags
throws
UnexpectedCallException

If no appropriate method prophecy found

Return values
mixed

Returns null if no promise for prophecy found or promise return value.

createUnexpectedCallException()

private createUnexpectedCallException(ObjectProphecy $prophecy, mixed $methodName, array<string|int, mixed> $arguments) : mixed
Parameters
$prophecy : ObjectProphecy
$methodName : mixed
$arguments : array<string|int, mixed>
Return values
mixed

findMethodProphecies()

private findMethodProphecies(ObjectProphecy $prophecy, string $methodName, array<string|int, mixed> $arguments) : array<string|int, mixed>
Parameters
$prophecy : ObjectProphecy
$methodName : string
$arguments : array<string|int, mixed>
Return values
array<string|int, mixed>

indentArguments()

private indentArguments(array<string|int, mixed> $arguments, mixed $indentationLength) : mixed
Parameters
$arguments : array<string|int, mixed>
$indentationLength : mixed
Return values
mixed

Search results