You are here

protected function HistoryTest::markNodeAsRead in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/history/src/Tests/HistoryTest.php \Drupal\history\Tests\HistoryTest::markNodeAsRead()

Mark a node as read for the current user.

Parameters

int $node_id: A node ID.

Return value

string The response body.

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

File

core/modules/history/src/Tests/HistoryTest.php, line 97
Contains \Drupal\history\Tests\HistoryTest.

Class

HistoryTest
Tests the History endpoints.

Namespace

Drupal\history\Tests

Code

protected function markNodeAsRead($node_id) {
  return $this
    ->curlExec(array(
    CURLOPT_URL => \Drupal::url('history.read_node', array(
      'node' => $node_id,
    ), array(
      'absolute' => TRUE,
    )),
    CURLOPT_HTTPHEADER => array(
      'Accept: application/json',
    ),
  ));
}