You are here

public function NodePreviewLinkTest::setUp in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/node/tests/src/FunctionalJavascript/NodePreviewLinkTest.php \Drupal\Tests\node\FunctionalJavascript\NodePreviewLinkTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/node/tests/src/FunctionalJavascript/NodePreviewLinkTest.php, line 28

Class

NodePreviewLinkTest
Tests the JavaScript prevention of navigation away from node previews.

Namespace

Drupal\Tests\node\FunctionalJavascript

Code

public function setUp() {
  parent::setUp();
  $filtered_html_format = FilterFormat::create([
    'format' => 'filtered_html',
    'name' => 'Filtered HTML',
  ]);
  $filtered_html_format
    ->save();
  $this
    ->drupalCreateContentType([
    'type' => 'test',
  ]);
  $user = $this
    ->drupalCreateUser([
    'access content',
    'edit own test content',
    'create test content',
    $filtered_html_format
      ->getPermissionName(),
  ]);
  $this
    ->drupalLogin($user);
}