function CommentTestBase::deleteComment

Deletes a comment.

Parameters

Drupal\comment\Comment $comment: Comment to delete.

1 call to CommentTestBase::deleteComment()
CommentInterfaceTest::testCommentInterface in drupal/core/modules/comment/lib/Drupal/comment/Tests/CommentInterfaceTest.php
Tests the comment interface.

File

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

Class

CommentTestBase
Provides setup and helper methods for comment tests.

Namespace

Drupal\comment\Tests

Code

function deleteComment(Comment $comment) {
  $this
    ->drupalPost('comment/' . $comment->id . '/delete', array(), t('Delete'));
  $this
    ->assertText(t('The comment and all its replies have been deleted.'), 'Comment deleted.');
}