You are here

public function NodeHelpTest::testNodeShowHelpText 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::testNodeShowHelpText()

Verifies that help text appears on node add/edit forms.

File

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

Class

NodeHelpTest
Tests help functionality for nodes.

Namespace

Drupal\Tests\node\Functional

Code

public function testNodeShowHelpText() {

  // Check the node add form.
  $this
    ->drupalGet('node/add/' . $this->testType);
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->pageTextContains($this->testText);

  // Create node and check the node edit form.
  $node = $this
    ->drupalCreateNode([
    'type' => $this->testType,
  ]);
  $this
    ->drupalGet('node/' . $node
    ->id() . '/edit');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->pageTextContains($this->testText);
}