You are here

protected function LinkCollectionNormalizerTest::getNormalizer in Drupal 10

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

Get an instance of the normalizer to test.

2 calls to LinkCollectionNormalizerTest::getNormalizer()
LinkCollectionNormalizerTest::testLinkAccess in core/modules/jsonapi/tests/src/Kernel/Normalizer/LinkCollectionNormalizerTest.php
Tests the link collection normalizer.
LinkCollectionNormalizerTest::testNormalize in core/modules/jsonapi/tests/src/Kernel/Normalizer/LinkCollectionNormalizerTest.php
Tests the link collection normalizer.

File

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

Class

LinkCollectionNormalizerTest
@coversDefaultClass \Drupal\jsonapi\Normalizer\LinkCollectionNormalizer @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;
}