You are here

protected function AbstractConstraintValidatorTest::expectValidateValueAt in Plug 7

13 calls to AbstractConstraintValidatorTest::expectValidateValueAt()
AllValidatorTest::testWalkMultipleConstraints in lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/AllValidatorTest.php
@dataProvider getValidArguments
AllValidatorTest::testWalkSingleConstraint in lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/AllValidatorTest.php
@dataProvider getValidArguments
CollectionValidatorTest::testExtraFieldsAllowed in lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/CollectionValidatorTest.php
CollectionValidatorTest::testExtraFieldsDisallowed in lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/CollectionValidatorTest.php
CollectionValidatorTest::testFieldsAsDefaultOption in lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/CollectionValidatorTest.php

... See full list

File

lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php, line 330

Class

AbstractConstraintValidatorTest
@since 2.5.3

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

protected function expectValidateValueAt($i, $propertyPath, $value, $constraints, $group = null) {
  switch ($this
    ->getApiVersion()) {
    case Validation::API_VERSION_2_4:
      $this->context
        ->expects($this
        ->at($i))
        ->method('validateValue')
        ->with($value, $constraints, $propertyPath, $group);
      break;
    case Validation::API_VERSION_2_5:
    case Validation::API_VERSION_2_5_BC:
      $contextualValidator = $this->context
        ->getValidator()
        ->inContext($this->context);
      $contextualValidator
        ->expects($this
        ->at(2 * $i))
        ->method('atPath')
        ->with($propertyPath)
        ->will($this
        ->returnValue($contextualValidator));
      $contextualValidator
        ->expects($this
        ->at(2 * $i + 1))
        ->method('validate')
        ->with($value, $constraints, $group);
      break;
  }
}