You are here

protected function InternalEntitiesTest::jsonapiGet in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/jsonapi/tests/src/Functional/InternalEntitiesTest.php \Drupal\Tests\jsonapi\Functional\InternalEntitiesTest::jsonapiGet()
  2. 9 core/modules/jsonapi/tests/src/Functional/InternalEntitiesTest.php \Drupal\Tests\jsonapi\Functional\InternalEntitiesTest::jsonapiGet()

Performs an authenticated request and returns the decoded document.

File

core/modules/jsonapi/tests/src/Functional/InternalEntitiesTest.php, line 186

Class

InternalEntitiesTest
Makes assertions about the JSON:API behavior for internal entities.

Namespace

Drupal\Tests\jsonapi\Functional

Code

protected function jsonapiGet($path, array $options = []) {
  $this
    ->drupalLogin($this->testUser);
  $response = $this
    ->drupalGet($path, $options, [
    'Accept' => 'application/vnd.api+json',
  ]);
  return Json::decode($response);
}