You are here

function CommentHelperCase::getUnapprovedComment in Drupal 7

Get the comment ID for an unapproved comment.

Parameters

string $subject: Comment subject to find.

Return value

integer Comment id.

2 calls to CommentHelperCase::getUnapprovedComment()
CommentApprovalTest::testApprovalAdminInterface in modules/comment/comment.test
Test comment approval functionality through admin/content/comment.
CommentApprovalTest::testApprovalNodeInterface in modules/comment/comment.test
Test comment approval functionality through node interface.

File

modules/comment/comment.test, line 257
Tests for comment.module.

Class

CommentHelperCase
@file Tests for comment.module.

Code

function getUnapprovedComment($subject) {
  $this
    ->drupalGet('admin/content/comment/approval');
  preg_match('/href="(.*?)#comment-([^"]+)"(.*?)>(' . $subject . ')/', $this
    ->drupalGetContent(), $match);
  return $match[2];
}