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. |
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));
MockConfig::__construct | ( | $ | config | ) |
Load the mock config.
$config | Configuration array |
MockConfig::getConfig | ( | $ | namespace | ) |
Get configuration for a given namespace.
$namespace | Name of namespace |
MockConfig::setConfig | ( | $ | namespace, | |
$ | array | |||
) |
Set configuration for a given namespace.
$namespace | Name of namespace | |
$array | the new configuration of the given namespace |