You are here

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

File

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

Class

ImageValidatorTest
@requires extension fileinfo

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