public function FileValidatorTest::testUploadedFileError

@dataProvider uploadedFileErrorProvider

File

drupal/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php, line 291

Class

FileValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testUploadedFileError($error, $message, array $params = array(), $maxSize = null) {
  $file = new UploadedFile('/path/to/file', 'originalName', 'mime', 0, $error);
  $constraint = new File(array(
    $message => 'myMessage',
    'maxSize' => $maxSize,
  ));
  $this->context
    ->expects($this
    ->once())
    ->method('addViolation')
    ->with('myMessage', $params);
  $this->validator
    ->validate($file, $constraint);
}