You are here

public function ImageValidatorTest::testWidthTooBig in Plug 7

File

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

Class

ImageValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testWidthTooBig() {
  $constraint = new Image(array(
    'maxWidth' => 1,
    'maxWidthMessage' => 'myMessage',
  ));
  $this->validator
    ->validate($this->image, $constraint);
  $this
    ->buildViolation('myMessage')
    ->setParameter('{{ width }}', '2')
    ->setParameter('{{ max_width }}', '1')
    ->setCode(Image::TOO_WIDE_ERROR)
    ->assertRaised();
}