function CommentNewIndicatorTest::renderNewCommentsNodeLinks

Same name in other branches
  1. 8.9.x core/modules/comment/tests/src/Functional/CommentNewIndicatorTest.php \Drupal\Tests\comment\Functional\CommentNewIndicatorTest::renderNewCommentsNodeLinks()
  2. 10 core/modules/comment/tests/src/Functional/CommentNewIndicatorTest.php \Drupal\Tests\comment\Functional\CommentNewIndicatorTest::renderNewCommentsNodeLinks()
  3. 11.x 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',
        ],
    ]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.