public function FileValidatorTest::testDisallowEmpty 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::testDisallowEmpty()
File
- vendor/
symfony/ 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();
}