You are here

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

File

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

Class

ImageValidatorTest
@requires extension fileinfo

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