public function ExpressionValidatorTest::testSucceedingExpressionAtNestedPropertyLevel in Plug 7
File
- lib/
Symfony/ validator/ Symfony/ Component/ Validator/ Tests/ Constraints/ ExpressionValidatorTest.php, line 131
Class
Namespace
Symfony\Component\Validator\Tests\ConstraintsCode
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();
}