You are here

public function AllValidatorTest::testWalkSingleConstraint in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Tests/Constraints/AllValidatorTest.php \Symfony\Component\Validator\Tests\Constraints\AllValidatorTest::testWalkSingleConstraint()

@dataProvider getValidArguments

File

vendor/symfony/validator/Tests/Constraints/AllValidatorTest.php, line 50

Class

AllValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

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