You are here

protected function AbstractConstraintValidatorTest::expectValidateAt in Plug 7

File

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

Class

AbstractConstraintValidatorTest
@since 2.5.3

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

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