You are here

protected function CommentThreadingTest::assertNoParentLink in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/comment/tests/src/Functional/CommentThreadingTest.php \Drupal\Tests\comment\Functional\CommentThreadingTest::assertNoParentLink()
  2. 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.

@internal

Parameters

int $cid: The comment ID to check.

File

core/modules/comment/tests/src/Functional/CommentThreadingTest.php, line 166

Class

CommentThreadingTest
Tests to make sure the comment number increments properly.

Namespace

Drupal\Tests\comment\Functional

Code

protected function assertNoParentLink(int $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');
}