1 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

core/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,
    'cid' => '',
    'pid' => '',
  );
  $comment = entity_create('comment', $comment);
  return comment_save($comment);
}