function JsonApiSpecTest::providerTestIsValidCustomQueryParameter

Same name in other branches
  1. 9 core/modules/jsonapi/tests/src/Unit/JsonApiSpecTest.php \Drupal\Tests\jsonapi\Unit\JsonApiSpecTest::providerTestIsValidCustomQueryParameter()
  2. 8.9.x core/modules/jsonapi/tests/src/Unit/JsonApiSpecTest.php \Drupal\Tests\jsonapi\Unit\JsonApiSpecTest::providerTestIsValidCustomQueryParameter()
  3. 10 core/modules/jsonapi/tests/src/Unit/JsonApiSpecTest.php \Drupal\Tests\jsonapi\Unit\JsonApiSpecTest::providerTestIsValidCustomQueryParameter()

Data provider for testIsValidCustomQueryParameter.

File

core/modules/jsonapi/tests/src/Unit/JsonApiSpecTest.php, line 114

Class

JsonApiSpecTest
@coversDefaultClass \Drupal\jsonapi\JsonApiSpec @group jsonapi

Namespace

Drupal\Tests\jsonapi\Unit

Code

public static function providerTestIsValidCustomQueryParameter() {
    $data = static::providerTestIsValidMemberName();
    // All valid member names are also valid custom query parameters, except for
    // single-character ones.
    $data['single-character'][1] = FALSE;
    // Custom query parameter test cases.
    $data['custom-query-parameter-lowercase'] = [
        'foobar',
        FALSE,
    ];
    $data['custom-query-parameter-dash'] = [
        'foo-bar',
        TRUE,
    ];
    $data['custom-query-parameter-underscore'] = [
        'foo_bar',
        TRUE,
    ];
    $data['custom-query-parameter-camel-case'] = [
        'fooBar',
        TRUE,
    ];
    return $data;
}

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