File
- drupal/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php, line 131
Class
- FileValidatorTest
Namespace
Symfony\Component\Validator\Tests\Constraints
Code
public function testTooLargeMegaBytes() {
fwrite($this->file, str_repeat('0', 1400000));
$constraint = new File(array(
'maxSize' => '1M',
'maxSizeMessage' => 'myMessage',
));
$this->context
->expects($this
->once())
->method('addViolation')
->with('myMessage', array(
'{{ limit }}' => '1',
'{{ size }}' => '1.4',
'{{ suffix }}' => 'MB',
'{{ file }}' => $this->path,
));
$this->validator
->validate($this
->getFile($this->path), $constraint);
}