mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +02:00
MDL-47608 cachestore_mongo: fixed unit test error
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.
This commit is contained in:
parent
b49de5d930
commit
c1db791e98
6
cache/stores/mongodb/lib.php
vendored
6
cache/stores/mongodb/lib.php
vendored
@ -556,6 +556,9 @@ class cachestore_mongodb extends cache_store implements cache_is_configurable {
|
||||
}
|
||||
|
||||
$store = new cachestore_mongodb('Test mongodb', $configuration);
|
||||
if (!$store->is_ready()) {
|
||||
return false;
|
||||
}
|
||||
$store->initialise($definition);
|
||||
|
||||
return $store;
|
||||
@ -581,6 +584,9 @@ class cachestore_mongodb extends cache_store implements cache_is_configurable {
|
||||
$configuration['usesafe'] = 1;
|
||||
|
||||
$store = new cachestore_mongodb('Test mongodb', $configuration);
|
||||
if (!$store->is_ready()) {
|
||||
return false;
|
||||
}
|
||||
$store->initialise($definition);
|
||||
|
||||
return $store;
|
||||
|
Loading…
x
Reference in New Issue
Block a user