Documentation

ExpectationDirector
in package

Table of Contents

$_defaults  : array<string|int, mixed>
Stores an array of all default expectations for this mock
$_expectations  : array<string|int, mixed>
Stores an array of all expectations for this mock
$_expectedOrder  : int
The expected order of next call
$_mock  : MockInterface|LegacyMockInterface
Mock object the director is attached to
$_name  : string
Method name the director is directing
__construct()  : mixed
Constructor
addExpectation()  : mixed
Add a new expectation to the director
call()  : mixed
Handle a method call being directed by this instance
findExpectation()  : mixed
Attempt to locate an expectation matching the provided args
getDefaultExpectations()  : array<string|int, mixed>
Return all expectations assigned to this director
getExpectationCount()  : int
Return the number of expectations assigned to this director.
getExpectations()  : array<string|int, mixed>
Return all expectations assigned to this director
makeExpectationDefault()  : mixed
Make the given expectation a default for all others assuming it was correctly created last
verify()  : void
Verify all expectations of the director
_findExpectationIn()  : mixed
Search current array of expectations for a match

Properties

$_defaults

Stores an array of all default expectations for this mock

protected array<string|int, mixed> $_defaults = array()

$_expectations

Stores an array of all expectations for this mock

protected array<string|int, mixed> $_expectations = array()

$_expectedOrder

The expected order of next call

protected int $_expectedOrder = null

Methods

call()

Handle a method call being directed by this instance

public call(array<string|int, mixed> $args) : mixed
Parameters
$args : array<string|int, mixed>
Return values
mixed

findExpectation()

Attempt to locate an expectation matching the provided args

public findExpectation(array<string|int, mixed> $args) : mixed
Parameters
$args : array<string|int, mixed>
Return values
mixed

getDefaultExpectations()

Return all expectations assigned to this director

public getDefaultExpectations() : array<string|int, mixed>
Return values
array<string|int, mixed>

getExpectationCount()

Return the number of expectations assigned to this director.

public getExpectationCount() : int
Return values
int

getExpectations()

Return all expectations assigned to this director

public getExpectations() : array<string|int, mixed>
Return values
array<string|int, mixed>

makeExpectationDefault()

Make the given expectation a default for all others assuming it was correctly created last

public makeExpectationDefault(Expectation $expectation) : mixed
Parameters
$expectation : Expectation
Return values
mixed

_findExpectationIn()

Search current array of expectations for a match

protected _findExpectationIn(array<string|int, mixed> $expectations, array<string|int, mixed> $args) : mixed
Parameters
$expectations : array<string|int, mixed>
$args : array<string|int, mixed>
Return values
mixed

Search results