public function FileValidatorTest::uploadedFileErrorProvider in Zircon Profile 8.0        
                          
                  
                        Same name and namespace in other branches
- 8 vendor/symfony/validator/Tests/Constraints/FileValidatorTest.php \Symfony\Component\Validator\Tests\Constraints\FileValidatorTest::uploadedFileErrorProvider()
File
 
   - vendor/symfony/validator/Tests/Constraints/FileValidatorTest.php, line 434
Class
  
  - FileValidatorTest 
Namespace
  Symfony\Component\Validator\Tests\Constraints
Code
public function uploadedFileErrorProvider() {
  $tests = array(
    array(
      UPLOAD_ERR_FORM_SIZE,
      'uploadFormSizeErrorMessage',
    ),
    array(
      UPLOAD_ERR_PARTIAL,
      'uploadPartialErrorMessage',
    ),
    array(
      UPLOAD_ERR_NO_FILE,
      'uploadNoFileErrorMessage',
    ),
    array(
      UPLOAD_ERR_NO_TMP_DIR,
      'uploadNoTmpDirErrorMessage',
    ),
    array(
      UPLOAD_ERR_CANT_WRITE,
      'uploadCantWriteErrorMessage',
    ),
    array(
      UPLOAD_ERR_EXTENSION,
      'uploadExtensionErrorMessage',
    ),
  );
  if (class_exists('Symfony\\Component\\HttpFoundation\\File\\UploadedFile')) {
    
    $tests[] = array(
      UPLOAD_ERR_INI_SIZE,
      'uploadIniSizeErrorMessage',
      array(
        '{{ limit }}' => UploadedFile::getMaxFilesize() / 1048576,
        '{{ suffix }}' => 'MiB',
      ),
    );
    
    $tests[] = array(
      UPLOAD_ERR_INI_SIZE,
      'uploadIniSizeErrorMessage',
      array(
        '{{ limit }}' => 1,
        '{{ suffix }}' => 'bytes',
      ),
      '1',
    );
    
    $tests[] = array(
      UPLOAD_ERR_INI_SIZE,
      'uploadIniSizeErrorMessage',
      array(
        '{{ limit }}' => UploadedFile::getMaxFilesize() / 1048576,
        '{{ suffix }}' => 'MiB',
      ),
      '1000M',
    );
    
    $tests[] = array(
      UPLOAD_ERR_INI_SIZE,
      'uploadIniSizeErrorMessage',
      array(
        '{{ limit }}' => '0.1',
        '{{ suffix }}' => 'MB',
      ),
      '100K',
    );
  }
  return $tests;
}