/**
* {@inheritdoc}
*/
protected function setUp(): void
{ parent::
setUp();
$relationship_fields =
[ 'external' =>
new ResourceTypeRelationship('external'
),
'internal' =>
new ResourceTypeRelationship('internal'
),
'both' =>
new ResourceTypeRelationship('both'
),
];
$type_1 =
new ResourceType('entity_type_1', 'bundle_1_1', EntityInterface::
class, FALSE, TRUE, TRUE, FALSE,
$relationship_fields);
$type_2 =
new ResourceType('entity_type_2', 'bundle_2_1', EntityInterface::
class, TRUE, TRUE, TRUE, FALSE,
$relationship_fields);
$relatable_resource_types =
[ 'external' =>
[$type_1],
'internal' =>
[$type_2],
'both' =>
[$type_1,
$type_2],
];
$type_1->
setRelatableResourceTypes($relatable_resource_types);
$type_2->
setRelatableResourceTypes($relatable_resource_types);
// This type ensures that we can create routes for bundle IDs which might be
// cast from strings to integers. It should not affect related resource
// routing.