Class StaticCrossCuttingLoader
Class StaticCrossCuttingLoader
This class wraps the CrossCuttingLoader for static use.
CrossCuttingLoader enables loading of mockable objects for cross cutting concerns, that were not injected to the current object.
Category: System
Located at Loaders/CrossCuttingLoader/StaticCrossCuttingLoader.inc.php
Methods summary
public static
getObject( string $p_classname )
: object
In strict mode ($crossCuttingLoader->strictModeEnabled=true) this method accepts classes with implemented CrossCuttingObjectInterface only. Otherwise it throws an InvalidArgumentException.
public static
setRegisteredObjectsOnly( $bool_status )
If RegisteredObjectsOnly is enabled, the loader returns only objects, that were registered by the registerObject method before. RegisteredObjectsOnly should be enabled in all unit tests.
public static
registerObject( string $p_classname, object $object )
In strict mode ($crossCuttingLoader->strictModeEnabled=true) this method accepts classes with implemented CrossCuttingObjectInterface only. Otherwise it throws an InvalidArgumentException.