protected function CommentThreadingTest::assertNoParentLink

Asserts that the specified comment does not have a link to a parent.

@parm int $cid The comment ID to check.

1 call to CommentThreadingTest::assertNoParentLink()
CommentThreadingTest::testCommentThreading in drupal/core/modules/comment/lib/Drupal/comment/Tests/CommentThreadingTest.php
Tests the comment threading.

File

drupal/core/modules/comment/lib/Drupal/comment/Tests/CommentThreadingTest.php, line 161
Definition of Drupal\comment\Tests\CommentThreadingTest.

Class

CommentThreadingTest
Tests comment threading.

Namespace

Drupal\comment\Tests

Code

protected function assertNoParentLink($cid) {

  // This pattern matches a markup structure like:
  // <a id="comment-2"></a>
  // <article>
  //   <p class="parent"></p>
  //  </article>
  $pattern = "//a[@id='comment-{$cid}']/following-sibling::article//p[contains(@class, 'parent')]";
  $this
    ->assertNoFieldByXpath($pattern, NULL, format_string('Comment %cid does not have a link to a parent.', array(
    '%cid' => $cid,
  )));
}