function JsonApiDocumentTopLevelNormalizerTest::getNormalizer
Helper to load the normalizer.
File
- 
              core/
modules/ jsonapi/ tests/ src/ Kernel/ Normalizer/ JsonApiDocumentTopLevelNormalizerTest.php, line 731  
Class
- JsonApiDocumentTopLevelNormalizerTest
 - @coversDefaultClass \Drupal\jsonapi\Normalizer\JsonApiDocumentTopLevelNormalizer[[api-linebreak]] @group jsonapi
 
Namespace
Drupal\Tests\jsonapi\Kernel\NormalizerCode
protected function getNormalizer() {
  $normalizer_service = $this->container
    ->get('jsonapi_test_normalizers_kernel.jsonapi_document_toplevel');
  // Simulate what happens when this normalizer service is used via the
  // serializer service, as it is meant to be used.
  $normalizer_service->setSerializer($this->container
    ->get('jsonapi.serializer'));
  return $normalizer_service;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.