You are here

public function FilterTest::testInvalidFilterPathDueToElidedSoleProperty in JSON:API 8.2

@covers ::queryCondition

File

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

Class

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

Namespace

Drupal\Tests\jsonapi\Kernel\Query

Code

public function testInvalidFilterPathDueToElidedSoleProperty() {
  $this
    ->setExpectedException(CacheableBadRequestHttpException::class, 'Invalid nested filtering. The property `value`, given in the path `promote.value`, does not exist. Filter by `promote`, not `promote.value` (the JSON:API module elides property names from single-property fields).');
  $resource_type = new ResourceType('node', 'painting', NULL);
  Filter::createFromQueryParameter([
    'promote.value' => '',
  ], $resource_type, $this->fieldResolver);
}