function BlockCacheTestCase::testCacheGlobal in Drupal 7
Test DRUPAL_CACHE_GLOBAL.
File
- modules/
block/ block.test, line 574 - Tests for block.module.
Class
- BlockCacheTestCase
- Test block caching.
Code
function testCacheGlobal() {
$this
->setCacheMode(DRUPAL_CACHE_GLOBAL);
$current_content = $this
->randomName();
variable_set('block_test_content', $current_content);
$this
->drupalGet('');
$this
->assertText($current_content, 'Block content displays.');
$old_content = $current_content;
$current_content = $this
->randomName();
variable_set('block_test_content', $current_content);
$this
->drupalLogout();
$this
->drupalGet('user');
$this
->assertText($old_content, 'Block content served from global cache.');
}