function CommentFieldsTest::testCommentFormat

Tests that comment module works correctly with plain text format.

File

drupal/core/modules/comment/lib/Drupal/comment/Tests/CommentFieldsTest.php, line 106
Definition of Drupal\comment\Tests\CommentFieldsTest.

Class

CommentFieldsTest
Tests fields on comments.

Namespace

Drupal\comment\Tests

Code

function testCommentFormat() {

  // Disable text processing for comments.
  $this
    ->drupalLogin($this->admin_user);
  $edit = array(
    'instance[settings][text_processing]' => 0,
  );
  $this
    ->drupalPost('admin/structure/types/manage/article/comment/fields/comment.comment_node_article.comment_body', $edit, t('Save settings'));

  // Post a comment without an explicit subject.
  $this
    ->drupalLogin($this->web_user);
  $edit = array(
    'comment_body[und][0][value]' => $this
      ->randomName(8),
  );
  $this
    ->drupalPost('node/' . $this->node->nid, $edit, t('Save'));
}