You are here

public function ImageValidatorTest::testWidthTooSmall in Plug 7

File

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

Class

ImageValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testWidthTooSmall() {
  $constraint = new Image(array(
    'minWidth' => 3,
    'minWidthMessage' => 'myMessage',
  ));
  $this->validator
    ->validate($this->image, $constraint);
  $this
    ->buildViolation('myMessage')
    ->setParameter('{{ width }}', '2')
    ->setParameter('{{ min_width }}', '3')
    ->setCode(Image::TOO_NARROW_ERROR)
    ->assertRaised();
}