You are here

protected function JsonApiDocumentTopLevelNormalizerTest::getNormalizer in JSON:API 8

Same name and namespace in other branches
  1. 8.2 tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php \Drupal\Tests\jsonapi\Kernel\Normalizer\JsonApiDocumentTopLevelNormalizerTest::getNormalizer()

Helper to load the normalizer.

File

tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php, line 731

Class

JsonApiDocumentTopLevelNormalizerTest
@coversDefaultClass \Drupal\jsonapi\Normalizer\JsonApiDocumentTopLevelNormalizer @group jsonapi @group legacy

Namespace

Drupal\Tests\jsonapi\Kernel\Normalizer

Code

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_do_not_use_removal_imminent'));
  return $normalizer_service;
}