protected function CommentThreadingTest::assertNoParentLink in Drupal 8
Same name and namespace in other branches
- 9 core/modules/comment/tests/src/Functional/CommentThreadingTest.php \Drupal\Tests\comment\Functional\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/ tests/ src/ Functional/ CommentThreadingTest.php 
- Tests the comment threading.
File
- core/modules/ comment/ tests/ src/ Functional/ CommentThreadingTest.php, line 161 
Class
- CommentThreadingTest
- Tests to make sure the comment number increments properly.
Namespace
Drupal\Tests\comment\FunctionalCode
protected function assertNoParentLink($cid) {
  // This pattern matches a markup structure like:
  // <a id="comment-2"></a>
  // <article>
  //   <p class="parent"></p>
  //  </article>
  $pattern = "//article[@id='comment-{$cid}']//p[contains(@class, 'parent')]";
  $this
    ->assertNoFieldByXpath($pattern, NULL, new FormattableMarkup('Comment %cid does not have a link to a parent.', [
    '%cid' => $cid,
  ]));
}