You are here

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

File

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

Class

ImageValidatorTest
@requires extension fileinfo

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testRatioTooBig() {
  $constraint = new Image(array(
    'maxRatio' => 0.5,
    'maxRatioMessage' => 'myMessage',
  ));
  $this->validator
    ->validate($this->image, $constraint);
  $this
    ->buildViolation('myMessage')
    ->setParameter('{{ ratio }}', 1)
    ->setParameter('{{ max_ratio }}', 0.5)
    ->setCode(Image::RATIO_TOO_BIG_ERROR)
    ->assertRaised();
}