// Modify the entity under test to use the provided parent terms.
$this->entity->
set('parent',
$parent_term_ids)->
save();
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/drupal/issues/2878463.
$url = Url::
fromRoute(sprintf('jsonapi.%s.individual',
static::
$resourceTypeName),
['entity' =>
$this->entity->
uuid()]);
// $url = $this->entity->toUrl('jsonapi');
$request_options =
[];
$request_options[RequestOptions::HEADERS
]['Accept'
] = 'application/vnd.api+json';
$request_options = NestedArray::
mergeDeep($request_options,
$this->
getAuthenticationRequestOptions());
$this->
setUpAuthorization('GET'
);
$response =
$this->
request('GET',
$url,
$request_options);
$this->
assertSameDocument($this->
getExpectedDocument(), Json::
decode($response->
getBody()));
} /**
* Data provider for ::testGetIndividualTermWithParent().
*/
public function providerTestGetIndividualTermWithParent() { return [ 'root parent: [0] (= no parent)' =>
[ [0
],
],
'non-root parent: [2]' =>
[ [