You are here

protected static function ResourceResponseTestTrait::toResourceResponses in Drupal 10

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

Maps an array of PSR responses to JSON:API ResourceResponses.

Parameters

\Psr\Http\Message\ResponseInterface[] $responses: The PSR responses to be mapped.

Return value

\Drupal\jsonapi\ResourceResponse[] The ResourceResponses.

File

core/modules/jsonapi/tests/src/Functional/ResourceResponseTestTrait.php, line 219

Class

ResourceResponseTestTrait
Utility methods for handling resource responses.

Namespace

Drupal\Tests\jsonapi\Functional

Code

protected static function toResourceResponses(array $responses) {
  return array_map([
    self::class,
    'toResourceResponse',
  ], $responses);
}