function CommentHelperCase::getUnapprovedComment

7.x comment.test CommentHelperCase::getUnapprovedComment($subject)

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 drupal-7.x/modules/comment/comment.test
Test comment approval functionality through admin/content/comment.
CommentApprovalTest::testApprovalNodeInterface in drupal-7.x/modules/comment/comment.test
Test comment approval functionality through node interface.

File

drupal-7.x/modules/comment/comment.test, line 249
Tests for comment.module.

Class

CommentHelperCase

Code

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

  return $match[2];
}