MockConfig Class Reference

Mock replacement for op5Config class. More...

Public Member Functions

 __construct ($config)
 Load the mock config.
 getConfig ($namespace)
 Get configuration for a given namespace.
 setConfig ($namespace, $array)
 Set configuration for a given namespace.

Data Fields

 $config
 Active configuration, can be used to directly verify and modify config from the test interface.

Detailed Description

Mock replacement for op5Config class.

Takes a configuraiton as argument to the constructor. Useful to have inline configurations in unit tests.

Use it adding it to the mock interface of op5objstore:

op5objstore::instance()->mock('op5config', new MockConfig($config));


Constructor & Destructor Documentation

MockConfig::__construct ( config  ) 

Load the mock config.

Parameters:
$config Configuration array

Member Function Documentation

MockConfig::getConfig ( namespace  ) 

Get configuration for a given namespace.

Parameters:
$namespace Name of namespace
Returns:
array Configuration for the namespace
MockConfig::setConfig ( namespace,
array 
)

Set configuration for a given namespace.

Parameters:
$namespace Name of namespace
$array the new configuration of the given namespace

The documentation for this class was generated from the following file:
 All Data Structures Functions Variables

Generated on 19 Dec 2018 for ninja by  doxygen 1.6.1