Chris@0: drupalCreateUser([ Chris@0: 'administer content types', Chris@0: 'administer nodes', Chris@0: 'bypass node access', Chris@0: ]); Chris@0: Chris@0: $this->drupalLogin($admin_user); Chris@0: $this->drupalPlaceBlock('help_block'); Chris@0: Chris@0: $this->testType = 'type'; Chris@0: $this->testText = t('Help text to find on node forms.'); Chris@0: Chris@0: // Create content type. Chris@0: $this->drupalCreateContentType([ Chris@0: 'type' => $this->testType, Chris@0: 'help' => $this->testText, Chris@0: ]); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Verifies that help text appears on node add/edit forms. Chris@0: */ Chris@0: public function testNodeShowHelpText() { Chris@0: // Check the node add form. Chris@0: $this->drupalGet('node/add/' . $this->testType); Chris@0: $this->assertResponse(200); Chris@0: $this->assertText($this->testText); Chris@0: Chris@0: // Create node and check the node edit form. Chris@0: $node = $this->drupalCreateNode(['type' => $this->testType]); Chris@0: $this->drupalGet('node/' . $node->id() . '/edit'); Chris@0: $this->assertResponse(200); Chris@0: $this->assertText($this->testText); Chris@0: } Chris@0: Chris@0: }