public function ImageValidatorTest::testValidSize

File

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

Class

ImageValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testValidSize() {
  if (!class_exists('Symfony\\Component\\HttpFoundation\\File\\File')) {
    $this
      ->markTestSkipped('The "HttpFoundation" component is not available');
  }
  $this->context
    ->expects($this
    ->never())
    ->method('addViolation');
  $constraint = new Image(array(
    'minWidth' => 1,
    'maxWidth' => 2,
    'minHeight' => 1,
    'maxHeight' => 2,
  ));
  $this->validator
    ->validate($this->image, $constraint);
}