function RestJsonApiUnsupported::setUpAuthorization

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

Overrides ResourceTestBase::setUpAuthorization

1 call to RestJsonApiUnsupported::setUpAuthorization()
RestJsonApiUnsupported::testApiJsonNotSupportedInRest in core/modules/jsonapi/tests/src/Functional/RestJsonApiUnsupported.php
Deploying a REST resource using api_json format results in 400 responses.

File

core/modules/jsonapi/tests/src/Functional/RestJsonApiUnsupported.php, line 53

Class

RestJsonApiUnsupported
Ensures that the 'api_json' format is not supported by the REST module.

Namespace

Drupal\Tests\jsonapi\Functional

Code

protected function setUpAuthorization($method) {
    switch ($method) {
        case 'GET':
            $this->grantPermissionsToTestedRole([
                'access content',
            ]);
            break;
        default:
            throw new \UnexpectedValueException();
    }
}

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