You are here

public function FilterTest::testInvalidFilterPathDueToMissingPropertyNameReferenceFieldWithMetaProperties in Drupal 8

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

@covers ::queryCondition

File

core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php, line 94

Class

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

Namespace

Drupal\Tests\jsonapi\Kernel\Query

Code

public function testInvalidFilterPathDueToMissingPropertyNameReferenceFieldWithMetaProperties() {
  $this
    ->expectException(CacheableBadRequestHttpException::class);
  $this
    ->expectExceptionMessage('Invalid nested filtering. The field `photo`, given in the path `photo` is incomplete, it must end with one of the following specifiers: `id`, `meta.alt`, `meta.title`, `meta.width`, `meta.height`.');
  $resource_type = $this->resourceTypeRepository
    ->get('node', 'painting');
  Filter::createFromQueryParameter([
    'photo' => '',
  ], $resource_type, $this->fieldResolver);
}