path = dirname(__FILE__) . '/../../lib/IDS/Config/Config.ini'; $this->init = IDS_Init::init($this->path); } function testInit() { $this->assertTrue($this->init instanceof IDS_Init); } function testInitConfig() { $keys = array('General', 'Logging', 'Caching'); $this->assertEquals($keys, array_keys($this->init->config)); } function testInitClone() { $config2 = clone $this->init; $this->assertEquals($config2, $this->init); } function testInitGetConfigPath() { $this->assertEquals($this->init->getConfigPath(), $this->path); } function testInitSetConfigOverwrite() { $this->init->setConfig(array('General' => array('filter_type' => 'json')), true); $this->assertEquals($this->init->config['General']['filter_type'], 'json'); $this->init->setConfig( array('General' => array('exceptions' => array('foo'))), true ); $this->assertSame( array('foo', '__utmc'), $this->init->config['General']['exceptions'] ); } function testInitSetConfigNoOverwrite() { $this->init->setConfig(array('General' => array('filter_type' => 'xml')), true); $this->init->setConfig(array('General' => array('filter_type' => 'json'))); $this->assertEquals($this->init->config['General']['filter_type'], 'xml'); } function testInitGetConfig() { $data = $this->init->getConfig(); $this->assertEquals($this->init->config, $data); } function testInstanciatingInitObjectWithoutPassingConfigFile() { $init = IDS_Init::init(); $this->assertType('IDS_Init', $init); $this->assertSame($init, IDS_Init::init()); } } /** * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 expandtab */