Skip to content

Commit

Permalink
More checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Jan 11, 2016
1 parent 057e470 commit 34a092f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions framework/Cache/test/Horde/Cache/MongoTest.php
Expand Up @@ -33,12 +33,18 @@ protected function _getCache($params = array())
}
if (!($config = self::getConfig('CACHE_MONGO_TEST_CONFIG', __DIR__)) ||
!isset($config['cache']['mongo']['hostspec'])) {
$this->reason = 'Mongo configuration not available';
return;
}
$factory = new Horde_Test_Factory_Mongo();
$this->mongo = $factory->create(array(
'config' => $config['cache']['mongo']['hostspec'],
'dbname' => 'horde_cache_test'
));
if (!$this->mongo) {
$this->reason = 'MongoDB not available.';
return;
}
return new Horde_Cache(
new Horde_Cache_Storage_Mongo(array(
'mongo_db' => $this->mongo,
Expand Down

0 comments on commit 34a092f

Please sign in to comment.