function FileUploadResourceTestBase::setUpAuthorization

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

Overrides ResourceTestBase::setUpAuthorization

11 calls to FileUploadResourceTestBase::setUpAuthorization()
FileUploadResourceTestBase::testFileUploadInvalidFileType in core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php
Tests using the file upload route with an invalid file type.
FileUploadResourceTestBase::testFileUploadLargerFileSize in core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php
Tests using the file upload route with a file size larger than allowed.
FileUploadResourceTestBase::testFileUploadMaliciousExtension in core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php
Tests using the file upload POST route with malicious extensions.
FileUploadResourceTestBase::testFileUploadNoExtensionSetting in core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php
Tests using the file upload POST route no extension configured.
FileUploadResourceTestBase::testFileUploadStrippedFilePath in core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php
Tests using the file upload route with any path prefixes being stripped.

... See full list

File

core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php, line 795

Class

FileUploadResourceTestBase
Tests binary data file upload route.

Namespace

Drupal\Tests\rest\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;
    }
}

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