MDL-56273 cache: Use is_ready() to determine if cache is really ready.

This commit is contained in:
Russell Smith
2016-10-31 19:44:05 +11:00
parent f9599c77cc
commit a330e83ade
3 changed files with 6 additions and 5 deletions
+2 -1
View File
@@ -60,7 +60,8 @@ class cachestore_memcache_test extends cachestore_tests {
$instance = new cachestore_memcache('Memcache Test', cachestore_memcache::unit_test_configuration());
$instance->initialise($definition);
if (!$instance) { // Something prevented memcache store to be inited (extension, TEST_CACHESTORE_MEMCACHE_TESTSERVERS...).
if (!$instance->is_ready()) {
// Something prevented memcache store to be inited (extension, TEST_CACHESTORE_MEMCACHE_TESTSERVERS...).
$this->markTestSkipped();
}
+1 -1
View File
@@ -170,7 +170,7 @@ class cachestore_memcached_test extends cachestore_tests {
$definition = cache_definition::load_adhoc(cache_store::MODE_APPLICATION, 'cachestore_memcached', 'phpunit_test');
$instance = cachestore_memcached::initialise_test_instance($definition);
if (!$instance) {
if (!$instance->is_ready()) {
$this->markTestSkipped();
}
+3 -3
View File
@@ -65,7 +65,7 @@ abstract class cachestore_tests extends advanced_testcase {
$instance = new $class($class.'_test', $class::unit_test_configuration());
$instance->initialise($definition);
if (!$instance) {
if (!$instance->is_ready()) {
$this->markTestSkipped('Could not test '.$class.'. No test instance configured for application caches.');
} else {
$this->run_tests($instance);
@@ -76,7 +76,7 @@ abstract class cachestore_tests extends advanced_testcase {
$instance = new $class($class.'_test', $class::unit_test_configuration());
$instance->initialise($definition);
if (!$instance) {
if (!$instance->is_ready()) {
$this->markTestSkipped('Could not test '.$class.'. No test instance configured for session caches.');
} else {
$this->run_tests($instance);
@@ -87,7 +87,7 @@ abstract class cachestore_tests extends advanced_testcase {
$instance = new $class($class.'_test', $class::unit_test_configuration());
$instance->initialise($definition);
if (!$instance) {
if (!$instance->is_ready()) {
$this->markTestSkipped('Could not test '.$class.'. No test instance configured for request caches.');
} else {
$this->run_tests($instance);