You are here

public function FilterTest::testInvalidFilterPathDueToMissingPropertyNameReferenceFieldWithMetaProperties in JSON:API 8.2

@covers ::queryCondition

File

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

Class

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

Namespace

Drupal\Tests\jsonapi\Kernel\Query

Code

public function testInvalidFilterPathDueToMissingPropertyNameReferenceFieldWithMetaProperties() {
  $this
    ->setExpectedException(CacheableBadRequestHttpException::class, '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 = new ResourceType('node', 'painting', NULL);
  Filter::createFromQueryParameter([
    'photo' => '',
  ], $resource_type, $this->fieldResolver);
}