You are here

protected static function ResourceResponseTestTrait::getResourceLinks in JSON:API 8

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/ResourceResponseTestTrait.php \Drupal\Tests\jsonapi\Functional\ResourceResponseTestTrait::getResourceLinks()

Creates individual resource links for a list of resource identifiers.

Parameters

array $resource_identifiers: A list of resource identifiers for which to create links.

Return value

string[] The resource links.

2 calls to ResourceResponseTestTrait::getResourceLinks()
ResourceTestBase::getExpectedCollectionResponse in tests/src/Functional/ResourceTestBase.php
Returns a JSON API collection document for the expected entities.
ResourceTestBase::getExpectedRelatedResponses in tests/src/Functional/ResourceTestBase.php
Builds an array of expected related ResourceResponses, keyed by field name.

File

tests/src/Functional/ResourceResponseTestTrait.php, line 338

Class

ResourceResponseTestTrait
Utility methods for handling resource responses.

Namespace

Drupal\Tests\jsonapi\Functional

Code

protected static function getResourceLinks(array $resource_identifiers) {
  return array_map([
    static::class,
    'getResourceLink',
  ], $resource_identifiers);
}