You are here

public function CustomQueryParameterNamesAccessCheckTest::providerTestAccess in JSON:API 8

Data provider for testAccess.

File

tests/src/Unit/Access/CustomQueryParameterNamesAccessCheckTest.php, line 42

Class

CustomQueryParameterNamesAccessCheckTest
@coversDefaultClass \Drupal\jsonapi\Access\CustomQueryParameterNamesAccessCheck @group jsonapi

Namespace

Drupal\Tests\jsonapi\Unit\Access

Code

public function providerTestAccess() {
  $data = [];
  $data['Official query parameter: sort'] = [
    'sort',
    TRUE,
  ];
  $data['Official query parameter: page'] = [
    'page',
    TRUE,
  ];
  $data['Official query parameter: filter'] = [
    'filter',
    TRUE,
  ];
  $data['Valid member, but invalid custom query parameter'] = [
    'foobar',
    FALSE,
  ];
  $data['Valid custom query parameter: dash'] = [
    'foo-bar',
    TRUE,
  ];
  $data['Valid custom query parameter: underscore'] = [
    'foo_bar',
    TRUE,
  ];
  $data['Valid custom query parameter: camelcase'] = [
    'fooBar',
    TRUE,
  ];
  return $data;
}