function CacheActionsBinTestCase::testClearCacheCid in Cache Actions 6.2
Same name and namespace in other branches
- 7.2 cache_actions.test \CacheActionsBinTestCase::testClearCacheCid()
- 7 cache_actions.test \CacheActionsBinTestCase::testClearCacheCid()
Test clearing a specific cache cid.
File
- ./
cache_actions.test, line 97 - This file contains the tests for Cache Actions. All tests depend on the panels, views and rules that are defined by the cache actions test module.
Class
- CacheActionsBinTestCase
- Tests for clearing cache bins.
Code
function testClearCacheCid() {
// Needed in order to register the default rules.
drupal_flush_all_caches();
// Put a dummy value into the cache
cache_set('dummy', 'dummy_value', 'cache_cache_actions_test');
// Create a node. This will trigger the rule.
$node = $this
->drupalCreateNode();
// Let's try to get the cache cid from the cache. It should fail.
$value = cache_get('dummy', 'cache_cache_actions_test');
// We should not have gotten a value if the rule was triggered.
$this
->assertFalse($value, t('The value was removed from the cache.'));
}