You are here

public function WebformBlockCacheTest::setUp in Webform 6.x

Same name and namespace in other branches
  1. 8.5 tests/src/Functional/WebformBlockCacheTest.php \Drupal\Tests\webform\Functional\WebformBlockCacheTest::setUp()

Overrides WebformBrowserTestBase::setUp

File

tests/src/Functional/WebformBlockCacheTest.php, line 32

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\Functional

Code

public function setUp() {
  parent::setUp();
  $this->authenticatedUser = $this
    ->createUser([
    'access content',
  ]);
  $this
    ->createContentType([
    'type' => 'page',
  ]);
  Node::create([
    'title' => $this
      ->randomString(),
    'type' => 'page',
  ])
    ->save();
  $this
    ->drupalPlaceBlock('webform_block', [
    'webform_id' => 'contact',
    'region' => 'footer',
  ])
    ->save();
}