function UploadedFileConstraintValidatorTest::validateProvider

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

Data provider for ::testValidateFail.

File

core/modules/file/tests/src/Kernel/Validation/UploadedFileConstraintValidatorTest.php, line 104

Class

UploadedFileConstraintValidatorTest
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.