/** * @param array $options (optional) * @return boolean */ protected function initConfig(array $options = array()) { Config::destroyInstance(); if (!empty($options)) { return Config::init(new \MongoClient('mongodb://127.0.0.1', $options), 'ohdm-tests'); } return Config::init(new \MongoClient('mongodb://127.0.0.1', array('connect' => false)), 'ohdm-tests'); }
public function testGettingConfigInstanceThrowsExceptionWhenInitIsNotCalledFirst() { try { Config::destroyInstance(); Config::getInstance(); } catch (\Exception $e) { $this->assertInstanceOf('\\OhDM\\Exception\\ConfigException', $e); return; } $this->fail('expected exception'); }