Container
in package
Table of Contents
- BLOCKS = Mockery::BLOCKS
- $_allocatedOrder : int
- Order number of allocation
- $_currentOrder : int
- Current ordered number
- $_generator : Generator
- $_groups : array<string|int, mixed>
- Ordered groups
- $_loader : Loader
- $_mocks : array<string|int, mixed>
- Store of mock objects
- $_namedMocks : array<string|int, mixed>
- __construct() : mixed
- fetchMock() : Mock
- Return a specific remembered mock according to the array index it was stored to in this container instance
- getGenerator() : mixed
- getKeyOfDemeterMockFor() : string|null
- getLoader() : mixed
- getMocks() : array<string|int, mixed>
- instanceMock() : mixed
- isValidClassName() : bool
- see http://php.net/manual/en/language.oop5.basic.php
- mock() : Mock
- Generates a new mock object for this container
- mockery_allocateOrder() : int
- Fetch the next available allocation order number
- mockery_close() : void
- Reset the container to its original state
- mockery_getCurrentOrder() : int
- Get current ordered number
- mockery_getExpectationCount() : int
- Gets the count of expectations on the mocks
- mockery_getGroups() : array<string|int, mixed>
- Fetch array of ordered groups
- mockery_setCurrentOrder() : int
- Set current ordered number
- mockery_setGroup() : mixed
- Set ordering for a group
- mockery_teardown() : void
- Tear down tasks for this container
- mockery_thrownExceptions() : array<string|int, mixed>
- Retrieves all exceptions thrown by mocks
- mockery_validateOrder() : void
- Validate the current mock's ordering
- mockery_verify() : void
- Verify the container mocks
- rememberMock() : LegacyMockInterface|MockInterface
- Store a mock and set its container reference
- self() : Mock
- Retrieve the last remembered mock object, which is the same as saying retrieve the current mock being programmed where you have yet to call mock() to change it - thus why the method name is "self" since it will be be used during the programming of the same mock.
- _getInstance() : mixed
- checkForNamedMockClashes() : mixed
Constants
BLOCKS
public
mixed
BLOCKS
= Mockery::BLOCKS
Properties
$_allocatedOrder
Order number of allocation
protected
int
$_allocatedOrder
= 0
$_currentOrder
Current ordered number
protected
int
$_currentOrder
= 0
$_generator
protected
Generator
$_generator
$_groups
Ordered groups
protected
array<string|int, mixed>
$_groups
= array()
$_loader
protected
Loader
$_loader
$_mocks
Store of mock objects
protected
array<string|int, mixed>
$_mocks
= array()
$_namedMocks
protected
array<string|int, mixed>
$_namedMocks
= array()
Methods
__construct()
public
__construct([Generator $generator = null ][, Loader $loader = null ]) : mixed
Parameters
Return values
mixed —fetchMock()
Return a specific remembered mock according to the array index it was stored to in this container instance
public
fetchMock(mixed $reference) : Mock
Parameters
- $reference : mixed
Return values
Mock —getGenerator()
public
getGenerator() : mixed
Return values
mixed —getKeyOfDemeterMockFor()
public
getKeyOfDemeterMockFor(string $method, string $parent) : string|null
Parameters
- $method : string
- $parent : string
Return values
string|null —getLoader()
public
getLoader() : mixed
Return values
mixed —getMocks()
public
getMocks() : array<string|int, mixed>
Return values
array<string|int, mixed> —instanceMock()
public
instanceMock() : mixed
Return values
mixed —isValidClassName()
see http://php.net/manual/en/language.oop5.basic.php
public
isValidClassName(string $className) : bool
Parameters
- $className : string
Return values
bool —mock()
Generates a new mock object for this container
public
mock(array<string|int, mixed> ...$args) : Mock
I apologies in advance for this. A God Method just fits the API which doesn't require differentiating between classes, interfaces, abstracts, names or partials - just so long as it's something that can be mocked. I'll refactor it one day so it's easier to follow.
Parameters
- $args : array<string|int, mixed>
Tags
Return values
Mock —mockery_allocateOrder()
Fetch the next available allocation order number
public
mockery_allocateOrder() : int
Return values
int —mockery_close()
Reset the container to its original state
public
mockery_close() : void
Return values
void —mockery_getCurrentOrder()
Get current ordered number
public
mockery_getCurrentOrder() : int
Return values
int —mockery_getExpectationCount()
Gets the count of expectations on the mocks
public
mockery_getExpectationCount() : int
Return values
int —mockery_getGroups()
Fetch array of ordered groups
public
mockery_getGroups() : array<string|int, mixed>
Return values
array<string|int, mixed> —mockery_setCurrentOrder()
Set current ordered number
public
mockery_setCurrentOrder(int $order) : int
Parameters
- $order : int
Return values
int —The current order number that was set
mockery_setGroup()
Set ordering for a group
public
mockery_setGroup(mixed $group, int $order) : mixed
Parameters
- $group : mixed
- $order : int
Return values
mixed —mockery_teardown()
Tear down tasks for this container
public
mockery_teardown() : void
Tags
Return values
void —mockery_thrownExceptions()
Retrieves all exceptions thrown by mocks
public
mockery_thrownExceptions() : array<string|int, mixed>
Return values
array<string|int, mixed> —mockery_validateOrder()
Validate the current mock's ordering
public
mockery_validateOrder(string $method, int $order, LegacyMockInterface $mock) : void
Parameters
- $method : string
- $order : int
- $mock : LegacyMockInterface
Tags
Return values
void —mockery_verify()
Verify the container mocks
public
mockery_verify() : void
Return values
void —rememberMock()
Store a mock and set its container reference
public
rememberMock(Mock $mock) : LegacyMockInterface|MockInterface
Parameters
- $mock : Mock
Return values
LegacyMockInterface|MockInterface —self()
Retrieve the last remembered mock object, which is the same as saying retrieve the current mock being programmed where you have yet to call mock() to change it - thus why the method name is "self" since it will be be used during the programming of the same mock.
public
self() : Mock
Return values
Mock —_getInstance()
protected
_getInstance(mixed $mockName[, mixed $constructorArgs = null ]) : mixed
Parameters
- $mockName : mixed
- $constructorArgs : mixed = null
Return values
mixed —checkForNamedMockClashes()
protected
checkForNamedMockClashes(mixed $config) : mixed
Parameters
- $config : mixed