public function ImageValidatorTest::testHeightTooSmall

File

drupal/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/ImageValidatorTest.php, line 121

Class

ImageValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testHeightTooSmall() {
  if (!class_exists('Symfony\\Component\\HttpFoundation\\File\\File')) {
    $this
      ->markTestSkipped('The "HttpFoundation" component is not available');
  }
  $constraint = new Image(array(
    'minHeight' => 3,
    'minHeightMessage' => 'myMessage',
  ));
  $this->context
    ->expects($this
    ->once())
    ->method('addViolation')
    ->with('myMessage', array(
    '{{ height }}' => '2',
    '{{ min_height }}' => '3',
  ));
  $this->validator
    ->validate($this->image, $constraint);
}