You are here

protected function CommentAlterBaseTestCase::assertCommentPreview in Comment Alter 7

Asserts that previewing a comment doesn't produces any error.

Parameters

$nid: The node ID to post the comment for.

array $comment_edit: An array that gets added to the $edit array passed to $this->drupalPost().

1 call to CommentAlterBaseTestCase::assertCommentPreview()
CommentAlterBaseTestCase::createNodeThenPostComment in ./comment_alter.test
Create a node programmatically and post a comment using the psuedo browser.

File

./comment_alter.test, line 103
Functional tests for the Comment Alter module.

Class

CommentAlterBaseTestCase
Parent of all the test cases for Comment Alter.

Code

protected function assertCommentPreview($nid, $comment_edit) {
  $this
    ->drupalGet("node/{$nid}");
  $edit = array();
  $edit['comment_body[' . LANGUAGE_NONE . '][0][value]'] = $this
    ->randomName();
  $edit = array_merge($edit, $comment_edit);
  $this
    ->drupalPost(NULL, $edit, t('Preview'));
  $this
    ->assertNoText('Undefined index: new_vid in comment_alter_comment_view()', 'An error is thrown while previewing comments');

  // Make sure that we are back on the respective node page to tests the
  // comment diff without posting any comment.
  $this
    ->drupalGet("node/{$nid}");
}