You are here

protected function HistoryTest::getNodeReadTimestamps in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/history/tests/src/Functional/HistoryTest.php \Drupal\Tests\history\Functional\HistoryTest::getNodeReadTimestamps()

Get node read timestamps from the server for the current user.

Parameters

array $node_ids: An array of node IDs.

Return value

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

1 call to HistoryTest::getNodeReadTimestamps()
HistoryTest::testHistory in core/modules/history/tests/src/Functional/HistoryTest.php
Verifies that the history endpoints work.

File

core/modules/history/tests/src/Functional/HistoryTest.php, line 68

Class

HistoryTest
Tests the History endpoints.

Namespace

Drupal\Tests\history\Functional

Code

protected function getNodeReadTimestamps(array $node_ids) {

  // Perform HTTP request.
  $http_client = $this
    ->getHttpClient();
  $url = Url::fromRoute('history.get_last_node_view')
    ->setAbsolute()
    ->toString();
  return $http_client
    ->request('POST', $url, [
    'form_params' => [
      'node_ids' => $node_ids,
    ],
    'cookies' => $this
      ->getSessionCookies(),
    'http_errors' => FALSE,
  ]);
}