You are here

protected function NodeHelpTest::setUp in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/node/tests/src/Functional/NodeHelpTest.php \Drupal\Tests\node\Functional\NodeHelpTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/node/tests/src/Functional/NodeHelpTest.php, line 43

Class

NodeHelpTest
Tests help functionality for nodes.

Namespace

Drupal\Tests\node\Functional

Code

protected function setUp() : void {
  parent::setUp();

  // Create user.
  $admin_user = $this
    ->drupalCreateUser([
    'administer content types',
    'administer nodes',
    'bypass node access',
  ]);
  $this
    ->drupalLogin($admin_user);
  $this
    ->drupalPlaceBlock('help_block');
  $this->testType = 'type';
  $this->testText = 'Help text to find on node forms.';

  // Create content type.
  $this
    ->drupalCreateContentType([
    'type' => $this->testType,
    'help' => $this->testText,
  ]);
}