function FileUploadTest::setUpAuthorization

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

Overrides ResourceTestBase::setUpAuthorization

8 calls to FileUploadTest::setUpAuthorization()
FileUploadTest::testFileUploadNoConfiguration in core/modules/jsonapi/tests/src/Functional/FileUploadTest.php
Tests using the file upload POST route no configuration.
FileUploadTest::testFileUploadStrippedFilePath in core/modules/jsonapi/tests/src/Functional/FileUploadTest.php
Tests using the file upload route with any path prefixes being stripped.
FileUploadTest::testFileUploadUnicodeFilename in core/modules/jsonapi/tests/src/Functional/FileUploadTest.php
Tests using the file upload route with a unicode file name.
FileUploadTest::testFileUploadZeroByteFile in core/modules/jsonapi/tests/src/Functional/FileUploadTest.php
Tests using the file upload route with a zero byte file.
FileUploadTest::testInvalidFileUploads in core/modules/jsonapi/tests/src/Functional/FileUploadTest.php
Tests invalid file uploads.

... See full list

File

core/modules/jsonapi/tests/src/Functional/FileUploadTest.php, line 850

Class

FileUploadTest
Tests binary data file upload route.

Namespace

Drupal\Tests\jsonapi\Functional

Code

protected function setUpAuthorization($method) {
    switch ($method) {
        case 'GET':
            $this->grantPermissionsToTestedRole([
                'view test entity',
            ]);
            break;
        case 'POST':
            $this->grantPermissionsToTestedRole([
                'create entity_test entity_test_with_bundle entities',
                'access content',
            ]);
            break;
        case 'PATCH':
            $this->grantPermissionsToTestedRole([
                'administer entity_test content',
                'access content',
            ]);
            break;
    }
}

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