You are here

public function ImageValidatorTest::testHeightTooBig in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Tests/Constraints/ImageValidatorTest.php \Symfony\Component\Validator\Tests\Constraints\ImageValidatorTest::testHeightTooBig()

File

vendor/symfony/validator/Tests/Constraints/ImageValidatorTest.php, line 154

Class

ImageValidatorTest
@requires extension fileinfo

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();
}