1 comment.test CommentHelperCase::performCommentOperation($comment, $operation, $approval = FALSE)

Performs the specified operation on the specified comment.

Parameters

object $comment: Comment to perform operation on.

string $operation: Operation to perform.

boolean $approval: Operation is found on approval page.

File

core/modules/comment/tests/comment.test, line 312
Tests for the Comment module.

Class

CommentHelperCase

Code

function performCommentOperation($comment, $operation, $approval = FALSE) {
  $edit = array();
  $edit['operation'] = $operation;
  $edit['comments[' . $comment->id . ']'] = TRUE;
  $this->backdropPost('admin/content/comment' . ($approval ? '/approval' : ''), $edit, t('Execute'));

  if ($operation == 'delete') {
    $this->backdropPost(NULL, array(), t('Delete comments'));
    $this->assertRaw(format_plural(1, 'Deleted 1 comment.', 'Deleted @count comments.'), format_string('Operation @operation was performed on comment.', array('@operation' => $operation)));
  }
  else {
    $this->assertText(t('The update has been performed.'), format_string('Operation @operation was performed on comment.', array('@operation' => $operation)));
  }
}