You are here

public function ExpressionValidatorTest::testSucceedingExpressionAtNestedPropertyLevel in Zircon Profile 8

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

File

vendor/symfony/validator/Tests/Constraints/ExpressionValidatorTest.php, line 131

Class

ExpressionValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testSucceedingExpressionAtNestedPropertyLevel() {
  $constraint = new Expression('value == this.data');
  $object = new Entity();
  $object->data = '1';
  $root = new Entity();
  $root->reference = $object;
  $this
    ->setRoot($root);
  $this
    ->setPropertyPath('reference.data');
  $this
    ->setProperty($object, 'data');
  $this->validator
    ->validate('1', $constraint);
  $this
    ->assertNoViolation();
}