You are here

public function ImageValidatorTest::testRatioTooBig in Plug 7

File

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

Class

ImageValidatorTest

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