You are here

public function StyleTableTest::testTableCacheability in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/tests/src/Functional/Plugin/StyleTableTest.php \Drupal\Tests\views\Functional\Plugin\StyleTableTest::testTableCacheability()
  2. 10 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
    ->assertSession()
    ->responseHeaderEquals(DynamicPageCacheSubscriber::HEADER, 'MISS');
  $this
    ->drupalGet($url);
  $this
    ->assertSession()
    ->responseHeaderEquals(DynamicPageCacheSubscriber::HEADER, 'HIT');
}