function UploadedFileValidatorTest::validateProvider

Same name in other branches
  1. 11.x core/modules/file/tests/src/Kernel/Validation/UploadedFileValidatorTest.php \Drupal\Tests\file\Kernel\Validation\UploadedFileValidatorTest::validateProvider()

Data provider for ::testValidateFail.

File

core/modules/file/tests/src/Kernel/Validation/UploadedFileValidatorTest.php, line 106

Class

UploadedFileValidatorTest
Tests the uploaded file validator.

Namespace

Drupal\Tests\file\Kernel\Validation

Code

public static function validateProvider() : array {
    return [
        'ini size' => [
            \UPLOAD_ERR_INI_SIZE,
            'The file %s could not be saved because it exceeds 4 MB, the maximum allowed size for uploads.',
        ],
        'form size' => [
            \UPLOAD_ERR_FORM_SIZE,
            'The file %s could not be saved because it exceeds 4 MB, the maximum allowed size for uploads.',
        ],
        'partial file' => [
            \UPLOAD_ERR_PARTIAL,
            'The file %s could not be saved because the upload did not complete.',
        ],
        'no file' => [
            \UPLOAD_ERR_NO_FILE,
            'The file %s could not be saved because the upload did not complete.',
        ],
        'default' => [
            \UPLOAD_ERR_CANT_WRITE,
            'The file %s could not be saved. An unknown error has occurred.',
        ],
    ];
}

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