You are here

public function Anonymouspublishingtest::createComment in Anonymous Publishing 7

Helper function to create a comment.

4 calls to Anonymouspublishingtest::createComment()
Anonymouspublishingtest::createByPeBoth in tests/anonymous_publishing.test
Self-activate, persistent validation(0), by(2).
Anonymouspublishingtest::createSaNpBoth in tests/anonymous_publishing.test
Self-activate, verify each post(2), NA(0).
Anonymouspublishingtest::createSaPeBoth in tests/anonymous_publishing.test
Self-activate, persistent validation(0), NA(0)
Anonymouspublishingtest::createUnPeBoth in tests/anonymous_publishing.test
Self-activate.

File

tests/anonymous_publishing.test, line 62

Class

Anonymouspublishingtest
Tests for the Anonymous Publishing modules.

Code

public function createComment($url, $email = NULL, $alias = NULL) {
  $this
    ->drupalGet($url);
  $edit = array();
  $edit['subject'] = 'Comment: ' . $this
    ->randomName(8);
  $edit['comment_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($url, $edit, t('Save'));
}