function CommentHelperCase::setCommentPreview

Set comment preview setting.

Parameters

int $mode: Preview value.

11 calls to CommentHelperCase::setCommentPreview()
CommentContentRebuild::testCommentRebuild in drupal/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/modules/comment/comment.test
Test comment interface.
CommentInterfaceTest::testCommentNodeCommentStatistics in drupal/modules/comment/comment.test
Tests the node comment statistics.
CommentNodeAccessTest::testThreadedCommentView in drupal/modules/comment/comment.test
Test that threaded comments can be viewed.
CommentPagerTest::testCommentNewPageIndicator in drupal/modules/comment/comment.test
Test comment_new_page_count().

... See full list

File

drupal/modules/comment/comment.test, line 150
Tests for comment.module.

Class

CommentHelperCase
@file Tests for comment.module.

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,
  )));
}