\Drupal::
state()->
set('jsonapi_test_resource_type_builder.disabled_resource_types',
$disabled_resource_types);
Cache::
invalidateTags(['jsonapi_resource_types'
]);
$this->
assertFalse($this->resourceTypeRepository->
getByTypeName('node--article'
)->
isInternal());
$this->
assertTrue($this->resourceTypeRepository->
getByTypeName('node--page'
)->
isInternal());
$this->
assertTrue($this->resourceTypeRepository->
getByTypeName('user--user'
)->
isInternal());
} /**
* Tests that resource type fields can be aliased per resource type.
*/
public function testResourceTypeFieldAliasing() { $this->
assertSame($this->resourceTypeRepository->
getByTypeName('node--article'
)->
getPublicName('uid'
), 'uid'
);
$this->
assertSame($this->resourceTypeRepository->
getByTypeName('node--page'
)->
getPublicName('uid'
), 'uid'
);
$resource_type_field_aliases =
[ 'node--article' =>
[ 'uid' => 'author',
],
'node--page' =>
[ 'uid' => 'owner',
],
];
\Drupal::
state()->
set('jsonapi_test_resource_type_builder.resource_type_field_aliases',
$resource_type_field_aliases);
Cache::
invalidateTags(['jsonapi_resource_types'
]);