You are here

public function ImageValidatorTest::testRatioTooSmall in Plug 7

File

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

Class

ImageValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testRatioTooSmall() {
  $constraint = new Image(array(
    'minRatio' => 2,
    'minRatioMessage' => 'myMessage',
  ));
  $this->validator
    ->validate($this->image, $constraint);
  $this
    ->buildViolation('myMessage')
    ->setParameter('{{ ratio }}', 1)
    ->setParameter('{{ min_ratio }}', 2)
    ->setCode(Image::RATIO_TOO_SMALL_ERROR)
    ->assertRaised();
}