MDL-59427 MUC: cache_helper::purge_all should reset adhoc caches

This commit is contained in:
sam marshall
2017-06-30 11:15:30 +01:00
parent 5a651b43fb
commit 4998d3a5be
3 changed files with 22 additions and 0 deletions
+10
View File
@@ -1730,6 +1730,16 @@ class core_cache_testcase extends advanced_testcase {
}
}
/**
* Tests that ad-hoc caches are correctly purged with a purge_all call.
*/
public function test_purge_all_with_adhoc_caches() {
$cache = \cache::make_from_params(\cache_store::MODE_REQUEST, 'core_cache', 'test');
$cache->set('test', 123);
cache_helper::purge_all();
$this->assertFalse($cache->get('test'));
}
/**
* Test that the default stores all support searching.
*/