You are here

function VarnishTestCase::deleteComment in Varnish 6

Delete a drupal comment.

Parameters

$comment the comment object or array.:

1 call to VarnishTestCase::deleteComment()
VarnishCacheInvalidationCase::testCommentCacheExpiration in ./varnish.test
Test that makes sure that the comment expiration works as expected.

File

./varnish.test, line 100
Tests the basic functionality of Varnish.

Class

VarnishTestCase
Base class for Varnish Test Cases.

Code

function deleteComment($comment) {

  // The comment is an array in comment_save, but it should be
  // an object when you delete it, so we do a conversion here in order
  // to avoid wtfs in the rest of the code.
  if (is_array($comment)) {
    $comment = (object) $comment;
  }

  // Functions for deleting comments resides in the admin.inc file.
  $status = module_load_include('admin.inc', 'comment');
  $this
    ->_commentDeleteHelper($comment);
}