function FilterTest::testInvalidFilterPathDueToMissingPropertyName

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

@covers ::queryCondition

File

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

Class

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

Namespace

Drupal\Tests\jsonapi\Kernel\Query

Code

public function testInvalidFilterPathDueToMissingPropertyName() {
    $this->expectException(CacheableBadRequestHttpException::class);
    $this->expectExceptionMessage('Invalid nested filtering. The field `colors`, given in the path `colors` is incomplete, it must end with one of the following specifiers: `value`, `format`, `processed`.');
    $resource_type = $this->resourceTypeRepository
        ->get('node', 'painting');
    Filter::createFromQueryParameter([
        'colors' => '',
    ], $resource_type, $this->fieldResolver);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.