$expected_related_responses =
$this->
getExpectedRelatedResponses($included_paths,
$request_options,
$entity);
if (empty($related_responses)) { return $expected_related_responses;
} foreach ($included_paths as $included_path) { $both_responses =
[$related_responses[$included_path],
$expected_related_responses[$included_path]];
$related_responses[$included_path] =
static::
toCollectionResourceResponse($both_responses,
$self_link, TRUE
);
} return $related_responses;
},
[]);
return static::
decorateExpectedResponseForIncludedFields($collection_response,
$related_responses);
} /**
* Tests GET of the related resource of an individual resource.
*
* Expected responses are built by making requests to 'relationship' routes.
* Using the fetched resource identifiers, if any, all targeted resources are
* fetched individually. These individual responses are then 'merged' into a
* single expected ResourceResponse. This is repeated for every relationship
* field of the resource type under test.
*/