You are here

protected function AbstractConstraintValidatorTest::setProperty in Plug 7

6 calls to AbstractConstraintValidatorTest::setProperty()
ExpressionValidatorTest::testFailingExpressionAtNestedPropertyLevel in lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/ExpressionValidatorTest.php
ExpressionValidatorTest::testFailingExpressionAtPropertyLevel in lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/ExpressionValidatorTest.php
ExpressionValidatorTest::testFailingExpressionAtPropertyLevelWithoutRoot in lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/ExpressionValidatorTest.php
When validatePropertyValue() is called with a class name https://github.com/symfony/symfony/pull/11498
ExpressionValidatorTest::testSucceedingExpressionAtNestedPropertyLevel in lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/ExpressionValidatorTest.php
ExpressionValidatorTest::testSucceedingExpressionAtPropertyLevel in lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/ExpressionValidatorTest.php

... See full list

File

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

Class

AbstractConstraintValidatorTest
@since 2.5.3

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

protected function setProperty($object, $property) {
  $this->object = $object;
  $this->metadata = is_object($object) ? new PropertyMetadata(get_class($object), $property) : null;
  switch ($this
    ->getApiVersion()) {
    case Validation::API_VERSION_2_4:
      $this->context = $this
        ->createContext();
      $this->validator
        ->initialize($this->context);
      break;
    case Validation::API_VERSION_2_5:
    case Validation::API_VERSION_2_5_BC:
      $this->context
        ->setNode($this->value, $this->object, $this->metadata, $this->propertyPath);
      break;
  }
}