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