You are here

public function AllValidatorTest::testWalkMultipleConstraints in Plug 7

@dataProvider getValidArguments

File

lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/AllValidatorTest.php, line 68

Class

AllValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testWalkMultipleConstraints($array) {
  $constraint1 = new Range(array(
    'min' => 4,
  ));
  $constraint2 = new NotNull();
  $constraints = array(
    $constraint1,
    $constraint2,
  );
  $i = 0;
  foreach ($array as $key => $value) {
    $this
      ->expectValidateValueAt($i++, '[' . $key . ']', $value, array(
      $constraint1,
      $constraint2,
    ));
  }
  $this->validator
    ->validate($array, new All($constraints));
  $this
    ->assertNoViolation();
}