function FilterTest::testInvalidFilterPathDueMissingMetaPrefixReferenceFieldWithMetaProperties

Same name and namespace in other branches
  1. 8.9.x core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php \Drupal\Tests\jsonapi\Kernel\Query\FilterTest::testInvalidFilterPathDueMissingMetaPrefixReferenceFieldWithMetaProperties()
  2. 10 core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php \Drupal\Tests\jsonapi\Kernel\Query\FilterTest::testInvalidFilterPathDueMissingMetaPrefixReferenceFieldWithMetaProperties()
  3. 11.x core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php \Drupal\Tests\jsonapi\Kernel\Query\FilterTest::testInvalidFilterPathDueMissingMetaPrefixReferenceFieldWithMetaProperties()

@covers ::queryCondition

File

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

Class

FilterTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21jsonapi%21src%21Query%21Filter.php/class/Filter/9" title="Gathers information about the filter parameter." class="local">\Drupal\jsonapi\Query\Filter</a> @group jsonapi @group jsonapi_query

Namespace

Drupal\Tests\jsonapi\Kernel\Query

Code

public function testInvalidFilterPathDueMissingMetaPrefixReferenceFieldWithMetaProperties() {
    $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.