Пример #1
0
 /**
  * @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');
 }
Пример #2
0
 public function testGettingConfigInstanceThrowsExceptionWhenInitIsNotCalledFirst()
 {
     try {
         Config::destroyInstance();
         Config::getInstance();
     } catch (\Exception $e) {
         $this->assertInstanceOf('\\OhDM\\Exception\\ConfigException', $e);
         return;
     }
     $this->fail('expected exception');
 }