You are here

public function ImageValidatorTest::testHeightTooBig in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 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();
}