You are here

public function StyleTableTest::testTableCacheability in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/tests/src/Functional/Plugin/StyleTableTest.php \Drupal\Tests\views\Functional\Plugin\StyleTableTest::testTableCacheability()

Tests the cacheability of the table display.

File

core/modules/views/tests/src/Functional/Plugin/StyleTableTest.php, line 248

Class

StyleTableTest
Tests the table style views plugin.

Namespace

Drupal\Tests\views\Functional\Plugin

Code

public function testTableCacheability() {
  \Drupal::service('module_installer')
    ->uninstall([
    'page_cache',
  ]);
  $url = 'test-table';
  $this
    ->drupalGet($url);
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertEquals('MISS', $this
    ->drupalGetHeader(DynamicPageCacheSubscriber::HEADER));
  $this
    ->drupalGet($url);
  $this
    ->assertEquals('HIT', $this
    ->drupalGetHeader(DynamicPageCacheSubscriber::HEADER));
}