function JsonApiDocumentTopLevelNormalizerTest::getNormalizer

Same name and namespace in other branches
  1. 9 core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php \Drupal\Tests\jsonapi\Kernel\Normalizer\JsonApiDocumentTopLevelNormalizerTest::getNormalizer()
  2. 8.9.x core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php \Drupal\Tests\jsonapi\Kernel\Normalizer\JsonApiDocumentTopLevelNormalizerTest::getNormalizer()
  3. 10 core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php \Drupal\Tests\jsonapi\Kernel\Normalizer\JsonApiDocumentTopLevelNormalizerTest::getNormalizer()

Helper to load the normalizer.

File

core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php, line 797

Class

JsonApiDocumentTopLevelNormalizerTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21jsonapi%21src%21Normalizer%21JsonApiDocumentTopLevelNormalizer.php/class/JsonApiDocumentTopLevelNormalizer/11.x" title="Normalizes the top-level document according to the JSON:API specification." class="local">\Drupal\jsonapi\Normalizer\JsonApiDocumentTopLevelNormalizer</a> @group jsonapi @group #slow

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.