function NodePostSettingsTest::testPageNotPostInfo

Confirms absence of post information on a new node.

File

drupal/core/modules/node/lib/Drupal/node/Tests/NodePostSettingsTest.php, line 56
Definition of Drupal\node\Tests\NodePostSettingsTest.

Class

NodePostSettingsTest
Checks that the post information displays when enabled for a content type.

Namespace

Drupal\node\Tests

Code

function testPageNotPostInfo() {

  // Set "Basic page" content type to display post information.
  $edit = array();
  $edit['node_submitted'] = FALSE;
  $this
    ->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type'));

  // Create a node.
  $edit = array();
  $langcode = LANGUAGE_NOT_SPECIFIED;
  $edit["title"] = $this
    ->randomName(8);
  $edit["body[{$langcode}][0][value]"] = $this
    ->randomName(16);
  $this
    ->drupalPost('node/add/page', $edit, t('Save'));

  // Check that the post information is displayed.
  $node = $this
    ->drupalGetNodeByTitle($edit["title"]);
  $this
    ->assertNoRaw('<span class="submitted">', 'Post information is not displayed.');
}