You are here

public function ImageValidatorTest::testFileNotFound in Plug 7

File

lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/ImageValidatorTest.php, line 74

Class

ImageValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testFileNotFound() {

  // Check that the logic from FileValidator still works
  $constraint = new Image(array(
    'notFoundMessage' => 'myMessage',
  ));
  $this->validator
    ->validate('foobar', $constraint);
  $this
    ->buildViolation('myMessage')
    ->setParameter('{{ file }}', '"foobar"')
    ->setCode(Image::NOT_FOUND_ERROR)
    ->assertRaised();
}