You are here

public function BlockCacheTest::testCacheGlobal in MongoDB 7

Test DRUPAL_CACHE_GLOBAL.

File

mongodb_block_ui/src/Tests/BlockCacheTest.php, line 118

Class

BlockCacheTest
Test block caching.

Namespace

Drupal\mongodb_block_ui\Tests

Code

public function testCacheGlobal() {
  $this
    ->setCacheMode(DRUPAL_CACHE_GLOBAL);
  $current_content = $this
    ->randomName();
  variable_set('block_test_content', $current_content);
  $this
    ->drupalGet('');
  $this
    ->assertText($current_content, t('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, t('Block content served from global cache.'));
}