summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests/cache.test
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2011-08-26 10:15:10 +0100
committerDries Buytaert <dries@buytaert.net>2011-08-26 10:15:10 +0100
commit98235359be5c6af7d27d458368f514c1a324e91d (patch)
tree4003b6e8c982e89b7c0f4973c7936e04223fdd0f /modules/simpletest/tests/cache.test
parentd70426b221c517b86e25d993853fca447ab789e5 (diff)
downloadbrdo-98235359be5c6af7d27d458368f514c1a324e91d.tar.gz
brdo-98235359be5c6af7d27d458368f514c1a324e91d.tar.bz2
- Patch #1259096 by Akaoni: cache Bin cache_path() is never cleaned up.
Diffstat (limited to 'modules/simpletest/tests/cache.test')
-rw-r--r--modules/simpletest/tests/cache.test21
1 files changed, 21 insertions, 0 deletions
diff --git a/modules/simpletest/tests/cache.test b/modules/simpletest/tests/cache.test
index 43d1fa122..954f57596 100644
--- a/modules/simpletest/tests/cache.test
+++ b/modules/simpletest/tests/cache.test
@@ -310,6 +310,27 @@ class CacheClearCase extends CacheTestCase {
|| $this->checkCacheExists('test_cid_clear3', $this->default_value),
t('All cache entries removed when the array exceeded the cache clear threshold.'));
}
+
+ /**
+ * Test drupal_flush_all_caches().
+ */
+ function testFlushAllCaches() {
+ // Create cache entries for each flushed cache bin.
+ $bins = array('cache', 'cache_filter', 'cache_page', 'cache_boostrap', 'cache_path');
+ $bins = array_merge(module_invoke_all('flush_caches'), $bins);
+ foreach ($bins as $id => $bin) {
+ $id = 'test_cid_clear' . $id;
+ cache_set($id, $this->default_value, $bin);
+ }
+
+ // Remove all caches then make sure that they are cleared.
+ drupal_flush_all_caches();
+
+ foreach ($bins as $id => $bin) {
+ $id = 'test_cid_clear' . $id;
+ $this->assertFalse($this->checkCacheExists($id, $this->default_value, $bin), t('All cache entries removed from @bin.', array('@bin' => $bin)));
+ }
+ }
}
/**