function BlockCacheTestCase::testCacheGlobal

Test DRUPAL_CACHE_GLOBAL.

File

drupal/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.');
}