function NodeHelpTest::testNodeShowHelpText

Same name and namespace in other branches
  1. 9 core/modules/node/tests/src/Functional/NodeHelpTest.php \Drupal\Tests\node\Functional\NodeHelpTest::testNodeShowHelpText()
  2. 8.9.x core/modules/node/tests/src/Functional/NodeHelpTest.php \Drupal\Tests\node\Functional\NodeHelpTest::testNodeShowHelpText()
  3. 11.x 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() : void {
  // 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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.