function LinkCollectionNormalizerTest::getNormalizer

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

Get an instance of the normalizer to test.

File

core/modules/jsonapi/tests/src/Kernel/Normalizer/LinkCollectionNormalizerTest.php, line 191

Class

LinkCollectionNormalizerTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21jsonapi%21src%21Normalizer%21LinkCollectionNormalizer.php/class/LinkCollectionNormalizer/9" title="Normalizes a LinkCollection object." class="local">\Drupal\jsonapi\Normalizer\LinkCollectionNormalizer</a> @group jsonapi

Namespace

Drupal\Tests\jsonapi\Kernel\Normalizer

Code

protected function getNormalizer(AccountInterface $current_user = NULL) {
    if (is_null($current_user)) {
        $current_user = $this->setUpCurrentUser();
    }
    else {
        $this->setCurrentUser($current_user);
    }
    $normalizer = new LinkCollectionNormalizer($current_user);
    $normalizer->setSerializer($this->serializer);
    return $normalizer;
}

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