function CommentHelperCase::setCommentPreview

7.x comment.test CommentHelperCase::setCommentPreview($mode)

Set comment preview setting.

Parameters

int $mode: Preview value.

11 calls to CommentHelperCase::setCommentPreview()
CommentContentRebuild::testCommentRebuild in drupal-7.x/modules/comment/comment.test
Test to ensure that the comment's content array is rebuilt for every call to comment_view().
CommentInterfaceTest::testCommentInterface in drupal-7.x/modules/comment/comment.test
Test comment interface.
CommentInterfaceTest::testCommentNodeCommentStatistics in drupal-7.x/modules/comment/comment.test
Tests the node comment statistics.
CommentNodeAccessTest::testThreadedCommentView in drupal-7.x/modules/comment/comment.test
Test that threaded comments can be viewed.
CommentPagerTest::testCommentNewPageIndicator in drupal-7.x/modules/comment/comment.test
Test comment_new_page_count().

... See full list

File

drupal-7.x/modules/comment/comment.test, line 144
Tests for comment.module.

Class

CommentHelperCase

Code

function setCommentPreview($mode) {
  switch ($mode) {
    case DRUPAL_DISABLED:
      $mode_text = 'disabled';
      break;

    case DRUPAL_OPTIONAL:
      $mode_text = 'optional';
      break;

    case DRUPAL_REQUIRED:
      $mode_text = 'required';
      break;
  }
  $this->setCommentSettings('comment_preview', $mode, format_string('Comment preview @mode_text.', array('@mode_text' => $mode_text)));
}