function FilterTest::testInvalidFilterPathDueToElidedSoleProperty
Same name and namespace in other branches
- 9 core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php \Drupal\Tests\jsonapi\Kernel\Query\FilterTest::testInvalidFilterPathDueToElidedSoleProperty()
- 10 core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php \Drupal\Tests\jsonapi\Kernel\Query\FilterTest::testInvalidFilterPathDueToElidedSoleProperty()
- 11.x core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php \Drupal\Tests\jsonapi\Kernel\Query\FilterTest::testInvalidFilterPathDueToElidedSoleProperty()
@covers ::queryCondition
File
-
core/
modules/ jsonapi/ tests/ src/ Kernel/ Query/ FilterTest.php, line 134
Class
- FilterTest
- @coversDefaultClass <a href="/api/drupal/core%21modules%21jsonapi%21src%21Query%21Filter.php/class/Filter/8.9.x" title="Gathers information about the filter parameter." class="local">\Drupal\jsonapi\Query\Filter</a> @group jsonapi @group jsonapi_query
Namespace
Drupal\Tests\jsonapi\Kernel\QueryCode
public function testInvalidFilterPathDueToElidedSoleProperty() {
$this->expectException(CacheableBadRequestHttpException::class);
$this->expectExceptionMessage('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 = $this->resourceTypeRepository
->get('node', 'painting');
Filter::createFromQueryParameter([
'promote.value' => '',
], $resource_type, $this->fieldResolver);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.