You are here

protected function SortNormalizerTest::getFieldResolver in JSON:API 8

Provides a mock field resolver.

1 call to SortNormalizerTest::getFieldResolver()
SortNormalizerTest::setUp in tests/src/Kernel/Normalizer/SortNormalizerTest.php

File

tests/src/Kernel/Normalizer/SortNormalizerTest.php, line 112

Class

SortNormalizerTest
@coversDefaultClass \Drupal\jsonapi\Normalizer\SortNormalizer @group jsonapi @group jsonapi_normalizers @group legacy

Namespace

Drupal\Tests\jsonapi\Kernel\Normalizer

Code

protected function getFieldResolver($entity_type_id, $bundle) {
  $field_resolver = $this
    ->prophesize(FieldResolver::class);
  $field_resolver
    ->resolveInternalEntityQueryPath('foo', 'bar', 'lorem')
    ->willReturn('foo');
  $field_resolver
    ->resolveInternalEntityQueryPath('foo', 'bar', 'ipsum')
    ->willReturn('bar');
  $field_resolver
    ->resolveInternalEntityQueryPath('foo', 'bar', 'dolor')
    ->willReturn('baz');
  $field_resolver
    ->resolveInternalEntityQueryPath('foo', 'bar', 'sit')
    ->willReturn('qux');
  return $field_resolver
    ->reveal();
}