You are here

protected function CommentNewIndicatorTest::renderNewCommentsNodeLinks in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/comment/tests/src/Functional/CommentNewIndicatorTest.php \Drupal\Tests\comment\Functional\CommentNewIndicatorTest::renderNewCommentsNodeLinks()

Get node "x new comments" metadata from the server for the current user.

Parameters

array $node_ids: An array of node IDs.

Return value

\Psr\Http\Message\ResponseInterface The HTTP response.

1 call to CommentNewIndicatorTest::renderNewCommentsNodeLinks()
CommentNewIndicatorTest::testCommentNewCommentsIndicator in core/modules/comment/tests/src/Functional/CommentNewIndicatorTest.php
Tests new comment marker.

File

core/modules/comment/tests/src/Functional/CommentNewIndicatorTest.php, line 41

Class

CommentNewIndicatorTest
Tests the 'new' indicator posted on comments.

Namespace

Drupal\Tests\comment\Functional

Code

protected function renderNewCommentsNodeLinks(array $node_ids) {
  $client = $this
    ->getHttpClient();
  $url = Url::fromRoute('comment.new_comments_node_links');
  return $client
    ->request('POST', $this
    ->buildUrl($url), [
    'cookies' => $this
      ->getSessionCookies(),
    'http_errors' => FALSE,
    'form_params' => [
      'node_ids' => $node_ids,
      'field_name' => 'comment',
    ],
  ]);
}