MDL-56273 cache: Use is_ready() to determine if cache is really ready.
This commit is contained in:
+2
-1
@@ -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
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Vendored
+3
-3
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user