public function WebformBlockCacheTest::testAuthenticatedVisitIsCacheable in Webform 8.5
Same name and namespace in other branches
- 6.x tests/src/Functional/WebformBlockCacheTest.php \Drupal\Tests\webform\Functional\WebformBlockCacheTest::testAuthenticatedVisitIsCacheable()
Test that admin user can visit the page and the it is cacheable.
File
- tests/
src/ Functional/ WebformBlockCacheTest.php, line 66
Class
- WebformBlockCacheTest
- These tests proof that the webform block which renders the webform as a block provides the correct cache tags / cache contexts so that cachability works.
Namespace
Drupal\Tests\webform\FunctionalCode
public function testAuthenticatedVisitIsCacheable() {
$this
->drupalLogin($this->authenticatedUser);
$this
->drupalGet('/node/1');
$this
->assertSession()
->responseContains('Contact');
$this
->assertEquals('MISS', $this
->drupalGetHeader('X-Drupal-Dynamic-Cache'));
$this
->drupalGet('/node/1');
$this
->assertEquals('HIT', $this
->drupalGetHeader('X-Drupal-Dynamic-Cache'));
}