function CommentThreadingTest::assertNoParentLink
Same name in other branches
- 9 core/modules/comment/tests/src/Functional/CommentThreadingTest.php \Drupal\Tests\comment\Functional\CommentThreadingTest::assertNoParentLink()
- 8.9.x core/modules/comment/tests/src/Functional/CommentThreadingTest.php \Drupal\Tests\comment\Functional\CommentThreadingTest::assertNoParentLink()
- 10 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.
@internal
Parameters
string $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 190
Class
- CommentThreadingTest
- Tests to make sure the comment number increments properly.
Namespace
Drupal\Tests\comment\FunctionalCode
protected function assertNoParentLink(string $cid) : void {
$pattern = "//article[@id='comment-{$cid}']";
// A parent link is always accompanied by the text "In reply to".
$this->assertSession()
->elementTextNotContains('xpath', $pattern, 'In reply to');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.