function CommentTestBase::deleteComment
Same name in this branch
- 8.9.x core/modules/comment/tests/src/Functional/CommentTestBase.php \Drupal\Tests\comment\Functional\CommentTestBase::deleteComment()
Same name in other branches
- 9 core/modules/comment/tests/src/Functional/CommentTestBase.php \Drupal\Tests\comment\Functional\CommentTestBase::deleteComment()
- 10 core/modules/comment/tests/src/Functional/CommentTestBase.php \Drupal\Tests\comment\Functional\CommentTestBase::deleteComment()
- 11.x 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/ src/ Tests/ CommentTestBase.php, line 233
Class
- CommentTestBase
- Provides setup and helper methods for comment tests.
Namespace
Drupal\comment\TestsCode
public function deleteComment(CommentInterface $comment) {
$this->drupalPostForm('comment/' . $comment->id() . '/delete', [], t('Delete'));
$this->assertText(t('The comment and all its replies have been deleted.'), 'Comment deleted.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.