You are here

protected function CommentThreadingTest::assertNoParentLink in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/comment/src/Tests/CommentThreadingTest.php \Drupal\comment\Tests\CommentThreadingTest::assertNoParentLink()

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

Parameters

int $cid: The comment ID to check.

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

File

core/modules/comment/src/Tests/CommentThreadingTest.php, line 160
Contains \Drupal\comment\Tests\CommentThreadingTest.

Class

CommentThreadingTest
Tests to make sure the comment number increments properly.

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,
  )));
}