diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-01-09 16:19:56 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-01-09 16:19:56 +0000 |
commit | cb159b9ff1b3165219292e63a89fa553d5811749 (patch) | |
tree | 3ebfbf4da01d867591855c0d3b2c81bca2b64809 /modules/node/node.test | |
parent | 3042f3385c65630a913e8ce6816bcd39526d5456 (diff) | |
download | brdo-cb159b9ff1b3165219292e63a89fa553d5811749.tar.gz brdo-cb159b9ff1b3165219292e63a89fa553d5811749.tar.bz2 |
#143434 by Jody Lynn: Move 'display post information' to where users would expect.
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 |