You are here

protected function FilterTest::getFieldResolverMock in JSON:API 8.2

Provides a mock field resolver.

2 calls to FilterTest::getFieldResolverMock()
FilterTest::testCreateFromQueryParameter in tests/src/Kernel/Query/FilterTest.php
@covers ::createFromQueryParameter @dataProvider parameterProvider
FilterTest::testCreateFromQueryParameterNested in tests/src/Kernel/Query/FilterTest.php
@covers ::createFromQueryParameter

File

tests/src/Kernel/Query/FilterTest.php, line 401

Class

FilterTest
@coversDefaultClass \Drupal\jsonapi\Query\Filter @group jsonapi @group jsonapi_query @group legacy

Namespace

Drupal\Tests\jsonapi\Kernel\Query

Code

protected function getFieldResolverMock(ResourceType $resource_type) {
  $field_resolver = $this
    ->prophesize(FieldResolver::class);
  $field_resolver
    ->resolveInternalEntityQueryPath($resource_type
    ->getEntityTypeId(), $resource_type
    ->getBundle(), Argument::any())
    ->willReturnArgument(2);
  return $field_resolver
    ->reveal();
}