Skip to content

Commit

Permalink
MDL-47608 cachestore_mongo: fixed unit test error
Browse files Browse the repository at this point in the history
If you configured your site to run mongo unit tests and had
the mongo extension and backend installed but did not have the
mongo service running you would get a fatal error when running
the unit tests.
That problem has been fixed by checking the mongo test instance
is ready before returning it.
  • Loading branch information
Sam Hemelryk committed Oct 19, 2014
1 parent 3eeb536 commit 19e095a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cache/stores/mongodb/lib.php
Expand Up @@ -556,6 +556,9 @@ public static function initialise_test_instance(cache_definition $definition) {
}

$store = new cachestore_mongodb('Test mongodb', $configuration);
if (!$store->is_ready()) {
return false;
}
$store->initialise($definition);

return $store;
Expand Down

0 comments on commit 19e095a

Please sign in to comment.