diff options
Diffstat (limited to 'modules/node/node.test')
-rw-r--r-- | modules/node/node.test | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/modules/node/node.test b/modules/node/node.test index 419a1dfd3..42294f721 100644 --- a/modules/node/node.test +++ b/modules/node/node.test @@ -537,3 +537,65 @@ class NodeBlockTestCase extends DrupalWebTestCase { $this->assertText(t('The block settings have been updated.'), t('Block successfully move to footer region.')); } } + +/** + * Check that the post information displays when enabled for a content type. + */ +class NodePostSettingsTestCase extends DrupalWebTestCase { + function getInfo() { + return array( + 'name' => t('Node post information display'), + 'description' => t('Check that the post information (submitted by Username on date) text displays appropriately.'), + 'group' => t('Node'), + ); + } + + function setUp() { + parent::setUp(); + + $web_user = $this->drupalCreateUser(array('create page content', 'administer content types', 'access user profiles')); + $this->drupalLogin($web_user); + } + + /** + * Set page content type to display post information and confirm its presence on a new node. + */ + function testPagePostInfo() { + + // Set page content type to display post information. + $edit = array(); + $edit['node_submitted'] = TRUE; + $this->drupalPost('admin/build/node-type/page', $edit, t('Save content type')); + + // Create a node. + $edit = array(); + $edit['title'] = $this->randomName(8); + $edit['body'] = $this->randomName(16); + $this->drupalPost('node/add/page', $edit, t('Save')); + + // Check that the post information is displayed. + $node = $this->drupalGetNodeByTitle($edit['title']); + $this->assertRaw(theme('node_submitted', $node), t('Post information is displayed.')); + } + + /** + * Set page content type to not display post information and confirm its absence on a new node. + */ + function testPageNotPostInfo() { + + // Set page content type to display post information. + $edit = array(); + $edit['node_submitted'] = FALSE; + $this->drupalPost('admin/build/node-type/page', $edit, t('Save content type')); + + // Create a node. + $edit = array(); + $edit['title'] = $this->randomName(8); + $edit['body'] = $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(theme('node_submitted', $node), t('Post information is not displayed.')); + } +}
\ No newline at end of file |