function CommentTestBase::getUnapprovedComment

Gets the comment ID for an unapproved comment.

Parameters

string $subject: Comment subject to find.

Return value

integer Comment id.

2 calls to CommentTestBase::getUnapprovedComment()
CommentApprovalTest::testApprovalAdminInterface in drupal/core/modules/comment/lib/Drupal/comment/Tests/CommentApprovalTest.php
Test comment approval functionality through admin/content/comment.
CommentApprovalTest::testApprovalNodeInterface in drupal/core/modules/comment/lib/Drupal/comment/Tests/CommentApprovalTest.php
Tests comment approval functionality through the node interface.

File

drupal/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php, line 316
Contains Drupal\comment\Tests\CommentTestBase.

Class

CommentTestBase
Provides setup and helper methods for comment tests.

Namespace

Drupal\comment\Tests

Code

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