You are here

public function CommentTestBase::deleteComment in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/comment/tests/src/Functional/CommentTestBase.php \Drupal\Tests\comment\Functional\CommentTestBase::deleteComment()
  2. 9 core/modules/comment/tests/src/Functional/CommentTestBase.php \Drupal\Tests\comment\Functional\CommentTestBase::deleteComment()

Deletes a comment.

Parameters

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

File

core/modules/comment/tests/src/Functional/CommentTestBase.php, line 229

Class

CommentTestBase
Provides setup and helper methods for comment tests.

Namespace

Drupal\Tests\comment\Functional

Code

public function deleteComment(CommentInterface $comment) {
  $this
    ->drupalGet('comment/' . $comment
    ->id() . '/delete');
  $this
    ->submitForm([], 'Delete');
  $this
    ->assertSession()
    ->pageTextContains('The comment and all its replies have been deleted.');
}