1 node.test | NodePostSettingsTestCase::testPagePostInfo() |
Confirms "Page" content type and post information is on a new node.
File
- core/
modules/ node/ tests/ node.test, line 1385 - Tests for node.module.
Class
- NodePostSettingsTestCase
- Checks that the post information displays when enabled for a content type.
Code
function testPagePostInfo() {
// Set "Page" content type to display post information.
$edit = array();
$edit['node_submitted'] = TRUE;
$this->backdropPost('admin/structure/types/manage/page', $edit, t('Save content type'));
// Create a node.
$edit = array();
$langcode = LANGUAGE_NONE;
$edit["title"] = $this->randomName(8);
$edit["body[$langcode][0][value]"] = $this->randomName(16);
$this->backdropPost('node/add/page', $edit, t('Save'));
// Check that the post information is displayed.
$elements = $this->xpath('//p[contains(@class, :class)]', array(':class' => 'submitted'));
$this->assertEqual(count($elements), 1, 'Post information is displayed.');
}