You are here

protected function CommentAlterBaseTestCase::postComment in Comment Alter 7

Post a comment to a node using the pseudo browser.

Parameters

$nid: The node ID to post the comment for.

array $comment_edit: An array that gets added to the $edit array passed to $this->drupalPost().

See also

DrupalWebTestCase::drupalPost()

2 calls to CommentAlterBaseTestCase::postComment()
CommentAlterBaseTestCase::createNodeThenPostComment in ./comment_alter.test
Create a node programmatically and post a comment using the psuedo browser.
CommentAlterDeletedRevisionTestCase::testOptionsSelectSingle in ./comment_alter.test

File

./comment_alter.test, line 86
Functional tests for the Comment Alter module.

Class

CommentAlterBaseTestCase
Parent of all the test cases for Comment Alter.

Code

protected function postComment($nid, $comment_edit) {
  $this
    ->drupalGet("node/{$nid}");
  $edit = array();
  $edit['comment_body[' . LANGUAGE_NONE . '][0][value]'] = $this
    ->randomName();
  $edit = array_merge($edit, $comment_edit);
  $this
    ->drupalPost(NULL, $edit, t('Save'));
}