public function FileValidatorTest::testDisallowEmpty in Plug 7
File
- lib/
Symfony/ validator/ Symfony/ Component/ Validator/ Tests/ Constraints/ FileValidatorTest.php, line 398
Class
Namespace
Symfony\Component\Validator\Tests\ConstraintsCode
public function testDisallowEmpty() {
ftruncate($this->file, 0);
$constraint = new File(array(
'disallowEmptyMessage' => 'myMessage',
));
$this->validator
->validate($this
->getFile($this->path), $constraint);
$this
->buildViolation('myMessage')
->setParameter('{{ file }}', '"' . $this->path . '"')
->setCode(File::EMPTY_ERROR)
->assertRaised();
}