You are here

public function FilterTest::testInvalidFilterPathDueToNonexistentProperty in JSON:API 8.2

@covers ::queryCondition

File

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

Class

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

Namespace

Drupal\Tests\jsonapi\Kernel\Query

Code

public function testInvalidFilterPathDueToNonexistentProperty() {
  $this
    ->setExpectedException(CacheableBadRequestHttpException::class, 'Invalid nested filtering. The property `foobar`, given in the path `colors.foobar`, does not exist. Must be one of the following property names: `value`, `format`, `processed`.');
  $resource_type = new ResourceType('node', 'painting', NULL);
  Filter::createFromQueryParameter([
    'colors.foobar' => '',
  ], $resource_type, $this->fieldResolver);
}