function CommentTestBase::setCommentPreview

Sets the value governing the previewing mode for the comment form.

Parameters

int $mode: The preview mode: DRUPAL_DISABLED, DRUPAL_OPTIONAL or DRUPAL_REQUIRED.

11 calls to CommentTestBase::setCommentPreview()
CommentAttributesTest::setUp in drupal/core/modules/rdf/lib/Drupal/rdf/Tests/CommentAttributesTest.php
Sets up a Drupal site for running functional and integration tests.
CommentContentRebuildTest::testCommentRebuild in drupal/core/modules/comment/lib/Drupal/comment/Tests/CommentContentRebuildTest.php
Tests the rebuilding of comment's content arrays on calling comment_view().
CommentInterfaceTest::testCommentInterface in drupal/core/modules/comment/lib/Drupal/comment/Tests/CommentInterfaceTest.php
Tests the comment interface.
CommentNodeAccessTest::testThreadedCommentView in drupal/core/modules/comment/lib/Drupal/comment/Tests/CommentNodeAccessTest.php
Test that threaded comments can be viewed.
CommentPagerTest::testCommentNewPageIndicator in drupal/core/modules/comment/lib/Drupal/comment/Tests/CommentPagerTest.php
Tests comment_new_page_count().

... See full list

File

drupal/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php, line 205
Contains Drupal\comment\Tests\CommentTestBase.

Class

CommentTestBase
Provides setup and helper methods for comment tests.

Namespace

Drupal\comment\Tests

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