You are here

public function ImageValidatorTest::testHeightTooBig in Plug 7

File

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

Class

ImageValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testHeightTooBig() {
  $constraint = new Image(array(
    'maxHeight' => 1,
    'maxHeightMessage' => 'myMessage',
  ));
  $this->validator
    ->validate($this->image, $constraint);
  $this
    ->buildViolation('myMessage')
    ->setParameter('{{ height }}', '2')
    ->setParameter('{{ max_height }}', '1')
    ->setCode(Image::TOO_HIGH_ERROR)
    ->assertRaised();
}