CacheIsEmptyCase::testIsEmpty

7 cache.test CacheIsEmptyCase::testIsEmpty()
8 cache.test CacheIsEmptyCase::testIsEmpty()

Test clearing using a cid.

File

modules/simpletest/tests/cache.test, line 400

Code

function testIsEmpty() {
  // Clear the cache bin.
  cache_clear_all('*', $this->default_bin);
  $this->assertTrue(cache_is_empty($this->default_bin), t('The cache bin is empty'));
  // Add some data to the cache bin.
  cache_set($this->default_cid, $this->default_value, $this->default_bin);
  $this->assertCacheExists(t('Cache was set.'), $this->default_value, $this->default_cid);
  $this->assertFalse(cache_is_empty($this->default_bin), t('The cache bin is not empty'));
  // Remove the cached data.
  cache_clear_all($this->default_cid, $this->default_bin);
  $this->assertCacheRemoved(t('Cache was removed.'), $this->default_cid);
  $this->assertTrue(cache_is_empty($this->default_bin), t('The cache bin is empty'));
}
Login or register to post comments