You are here

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

File

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

Class

ImageValidatorTest
@requires extension fileinfo

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testPortraitNotAllowed() {
  $constraint = new Image(array(
    'allowPortrait' => false,
    'allowPortraitMessage' => 'myMessage',
  ));
  $this->validator
    ->validate($this->imagePortrait, $constraint);
  $this
    ->buildViolation('myMessage')
    ->setParameter('{{ width }}', 1)
    ->setParameter('{{ height }}', 2)
    ->setCode(Image::PORTRAIT_NOT_ALLOWED_ERROR)
    ->assertRaised();
}