$this->container->
setAlias('sut', 'jsonapi.serializer'
);
$this->resourceType =
$this->container->
get('jsonapi.resource_type.repository'
)->
get($this->node->
getEntityTypeId(),
$this->node->
bundle());
$this->sut =
$this->container->
get('sut'
);
} /**
* @covers \Drupal\jsonapi\Serializer\Serializer::normalize
*/
public function testFallbackNormalizer() { $context =
[ 'account' =>
$this->user,
'resource_object' => ResourceObject::
createFromEntity($this->resourceType,
$this->node
),
];
$value =
$this->sut->
normalize($this->node->field_text, 'api_json',
$context);
$this->
assertInstanceOf(CacheableNormalization::
class,
$value);
$nested_field =
[ $this->node->field_text,
];
// When an object implements \IteratorAggregate and has corresponding
// fallback normalizer, it should be normalized by fallback normalizer.