You are here

public function ImageValidatorTest::testPortraitNotAllowed in Plug 7

File

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

Class

ImageValidatorTest

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