function FilterTest::testInvalidFilterPathDueMissingMetaPrefixReferenceFieldWithMetaProperties

Tests invalid filter path due missing meta prefix reference field with meta properties.

@legacy-covers ::queryCondition

File

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

Class

FilterTest
Tests Drupal\jsonapi\Query\Filter.

Namespace

Drupal\Tests\jsonapi\Kernel\Query

Code

public function testInvalidFilterPathDueMissingMetaPrefixReferenceFieldWithMetaProperties() : void {
  $this->expectException(CacheableBadRequestHttpException::class);
  $this->expectExceptionMessage('Invalid nested filtering. The property `alt`, given in the path `photo.alt` belongs to the meta object of a relationship and must be preceded by `meta`.');
  $resource_type = $this->resourceTypeRepository
    ->get('node', 'painting');
  Filter::createFromQueryParameter([
    'photo.alt' => '',
  ], $resource_type, $this->fieldResolver);
}

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