You are here

public function ImageValidatorTest::testWidthTooBig 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::testWidthTooBig()

File

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

Class

ImageValidatorTest
@requires extension fileinfo

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