PHP Class Mockery\Container

Afficher le fichier Open project: padraic/mockery Class Usage Examples

Protected Properties

Свойство Type Description
$_allocatedOrder integer Order number of allocation
$_currentOrder integer Current ordered number
$_generator Mockery\Generator\Generator\Generator
$_groups array Ordered groups
$_loader Mockery\Loader\Loader
$_mocks array Store of mock objects
$_namedMocks array

Méthodes publiques

Méthode Description
__construct ( Mockery\Generator\Generator $generator = null, Mockery\Loader\Loader $loader = null )
fetchMock ( $reference ) : Mock Return a specific remembered mock according to the array index it was stored to in this container instance
getGenerator ( )
getKeyOfDemeterMockFor ( string $method ) : string | null
getLoader ( )
getMocks ( ) : array
instanceMock ( )
isValidClassName ( string $className ) : boolean see http://php.net/manual/en/language.oop5.basic.php
mock ( ) : Mock Generates a new mock object for this container
mockery_allocateOrder ( ) : integer Fetch the next available allocation order number
mockery_close ( ) : void Reset the container to its original state
mockery_getCurrentOrder ( ) : integer Get current ordered number
mockery_getExpectationCount ( ) : integer Gets the count of expectations on the mocks
mockery_getGroups ( ) : array Fetch array of ordered groups
mockery_setCurrentOrder ( integer $order ) : integer Set current ordered number
mockery_setGroup ( mixed $group, integer $order ) Set ordering for a group
mockery_teardown ( ) : void Tear down tasks for this container
mockery_validateOrder ( string $method, integer $order, Mockery\MockInterface $mock ) : void Validate the current mock's ordering
mockery_verify ( ) : void Verify the container mocks
rememberMock ( Mockery\MockInterface $mock ) : Mock 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.

Méthodes protégées

Méthode Description
_getInstance ( $mockName, $constructorArgs = null )
checkForNamedMockClashes ( $config )

Method Details

__construct() public méthode

public __construct ( Mockery\Generator\Generator $generator = null, Mockery\Loader\Loader $loader = null )
$generator Mockery\Generator\Generator
$loader Mockery\Loader\Loader

_getInstance() protected méthode

protected _getInstance ( $mockName, $constructorArgs = null )

checkForNamedMockClashes() protected méthode

protected checkForNamedMockClashes ( $config )

fetchMock() public méthode

Return a specific remembered mock according to the array index it was stored to in this container instance
public fetchMock ( $reference ) : Mock
Résultat Mock

getGenerator() public méthode

public getGenerator ( )

getKeyOfDemeterMockFor() public méthode

public getKeyOfDemeterMockFor ( string $method ) : string | null
$method string
Résultat string | null

getLoader() public méthode

public getLoader ( )

getMocks() public méthode

public getMocks ( ) : array
Résultat array

instanceMock() public méthode

public instanceMock ( )

isValidClassName() public méthode

see http://php.net/manual/en/language.oop5.basic.php
public isValidClassName ( string $className ) : boolean
$className string
Résultat boolean

mock() public méthode

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.
public mock ( ) : Mock
Résultat Mock

mockery_allocateOrder() public méthode

Fetch the next available allocation order number
public mockery_allocateOrder ( ) : integer
Résultat integer

mockery_close() public méthode

Reset the container to its original state
public mockery_close ( ) : void
Résultat void

mockery_getCurrentOrder() public méthode

Get current ordered number
public mockery_getCurrentOrder ( ) : integer
Résultat integer

mockery_getExpectationCount() public méthode

Gets the count of expectations on the mocks

mockery_getGroups() public méthode

Fetch array of ordered groups
public mockery_getGroups ( ) : array
Résultat array

mockery_setCurrentOrder() public méthode

Set current ordered number
public mockery_setCurrentOrder ( integer $order ) : integer
$order integer
Résultat integer The current order number that was set

mockery_setGroup() public méthode

Set ordering for a group
public mockery_setGroup ( mixed $group, integer $order )
$group mixed
$order integer

mockery_teardown() public méthode

Tear down tasks for this container
public mockery_teardown ( ) : void
Résultat void

mockery_validateOrder() public méthode

Validate the current mock's ordering
public mockery_validateOrder ( string $method, integer $order, Mockery\MockInterface $mock ) : void
$method string
$order integer
$mock Mockery\MockInterface
Résultat void

mockery_verify() public méthode

Verify the container mocks
public mockery_verify ( ) : void
Résultat void

rememberMock() public méthode

Store a mock and set its container reference
public rememberMock ( Mockery\MockInterface $mock ) : Mock
$mock Mockery\MockInterface
Résultat Mock

self() public méthode

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
Résultat Mock

Property Details

$_allocatedOrder protected_oe property

Order number of allocation
protected int $_allocatedOrder
Résultat integer

$_currentOrder protected_oe property

Current ordered number
protected int $_currentOrder
Résultat integer

$_generator protected_oe property

protected Generator,Mockery\Generator\Generator $_generator
Résultat Mockery\Generator\Generator\Generator

$_groups protected_oe property

Ordered groups
protected array $_groups
Résultat array

$_loader protected_oe property

protected Loader,Mockery\Loader $_loader
Résultat Mockery\Loader\Loader

$_mocks protected_oe property

Store of mock objects
protected array $_mocks
Résultat array

$_namedMocks protected_oe property

protected array $_namedMocks
Résultat array