1.20.x comment_views_handler_argument_user_uid.test CommentViewsHandlerArgumentUserUidTest::postComment($node, $comment = array())

Post comment.

Parameters

$node: Node to post comment on.

$comment: Comment to save

File

modules/comment/tests/comment_views_handler_argument_user_uid.test, line 22
Definition of CommentViewsHandlerArgumentUserUidTest.

Class

CommentViewsHandlerArgumentUserUidTest
Tests the argument_comment_user_uid handler.

Code

function postComment($node, $comment = array()) {
  $comment += array(
    'uid' => $this->loggedInUser->uid,
    'nid' => $node->nid,
  );
  $comment = entity_create('comment', $comment);
  return comment_save($comment);
}