public function Anonymouspublishingtest::createNode in Anonymous Publishing 7
Helper function to create a node.
9 calls to Anonymouspublishingtest::createNode()
- Anonymouspublishingtest::apTestingActivation in tests/
anonymous_publishing.test - Test A.6: Testing activation of node.
- Anonymouspublishingtest::createAnonContentNoEmail in tests/
anonymous_publishing.test - Test A.2: Create anon content without giving an email address.
- Anonymouspublishingtest::createAnonContentWrongEmail in tests/
anonymous_publishing.test - Test A.3: Create anon contant win an invalid email address.
- Anonymouspublishingtest::createAnonRequireAlias in tests/
anonymous_publishing.test - Test A.4: Leave out the required alias.
- Anonymouspublishingtest::createByPeBoth in tests/
anonymous_publishing.test - Self-activate, persistent validation(0), by(2).
File
- tests/
anonymous_publishing.test, line 45
Class
- Anonymouspublishingtest
- Tests for the Anonymous Publishing modules.
Code
public function createNode($type, $email = NULL, $alias = NULL) {
$this
->drupalGet('/node/add/' . $type);
$edit = array();
$edit['title'] = 'Posting: ' . $this
->randomName(8);
$edit['body[und][0][value]'] = $this
->randomName(7) . ' ' . $this
->randomName(9) . '.';
if ($email) {
$edit['anonymous_publishing[email]'] = $email;
}
if ($alias) {
$edit['anonymous_publishing[alias]'] = $alias;
}
$this
->drupalPost('node/add/' . $type, $edit, t('Save'));
}