function viewsHandlerArgumentCommentUserUidTest::postComment
Post comment.
Parameters
object $node: Node to post comment on.
array $comment: Comment to save.
1 call to viewsHandlerArgumentCommentUserUidTest::postComment()
- viewsHandlerArgumentCommentUserUidTest::setUp in tests/
comment/ views_handler_argument_comment_user_uid.test - Sets up a Drupal site for running functional and integration tests.
File
-
tests/
comment/ views_handler_argument_comment_user_uid.test, line 32
Class
- viewsHandlerArgumentCommentUserUidTest
- Tests the argument_comment_user_uid handler.
Code
public function postComment($node, $comment = array()) {
$comment += array(
'uid' => $this->loggedInUser->uid,
'nid' => $node->nid,
'cid' => NULL,
// To indicate that a comment does not have a parent comment use the value
// zero instead of an empty string.
'pid' => 0,
);
return comment_save((object) $comment);
}