You are here

function CommentTestBase::deleteComment in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/comment/src/Tests/CommentTestBase.php \Drupal\comment\Tests\CommentTestBase::deleteComment()

Deletes a comment.

Parameters

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

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

File

core/modules/comment/src/Tests/CommentTestBase.php, line 222
Contains \Drupal\comment\Tests\CommentTestBase.

Class

CommentTestBase
Provides setup and helper methods for comment tests.

Namespace

Drupal\comment\Tests

Code

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