You are here

public function ImageValidatorTest::testLandscapeNotAllowed in Plug 7

File

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

Class

ImageValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testLandscapeNotAllowed() {
  $constraint = new Image(array(
    'allowLandscape' => false,
    'allowLandscapeMessage' => 'myMessage',
  ));
  $this->validator
    ->validate($this->imageLandscape, $constraint);
  $this
    ->buildViolation('myMessage')
    ->setParameter('{{ width }}', 2)
    ->setParameter('{{ height }}', 1)
    ->setCode(Image::LANDSCAPE_NOT_ALLOWED_ERROR)
    ->assertRaised();
}