You are here

public function NodeHelpTest::testNodeShowHelpText in Drupal 8

Same name and namespace in other branches
  1. 9 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
    ->assertText($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
    ->assertText($this->testText);
}