MDL-56273 cache: Use cache initialise always.
purge_all() and purge_by_definition() look in the configuration for which caches are available and then creates them to purge them. The configuration stores the values used by initialise(), not initialise_unit_test_instance() and would therefore fail to purge all caches if they were not purged by another means. In the case of filestore, it's purged by unit tests, in the case of memcache(d), it purges the whole store when a single definition is requested. Therefore all configuration was moved into the configuration file during unit tests and does not have any special override codes in the unit test infrastructure.
This commit is contained in:
+2
-1
@@ -57,7 +57,8 @@ class cachestore_memcache_test extends cachestore_tests {
|
||||
$this->resetAfterTest(true);
|
||||
|
||||
$definition = cache_definition::load_adhoc(cache_store::MODE_APPLICATION, 'cachestore_memcache', 'phpunit_test');
|
||||
$instance = cachestore_memcache::initialise_unit_test_instance($definition);
|
||||
$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...).
|
||||
$this->markTestSkipped();
|
||||
|
||||
Reference in New Issue
Block a user