public function ExpressionValidatorTest::testFailingExpressionAtNestedPropertyLevel in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/validator/Tests/Constraints/ExpressionValidatorTest.php \Symfony\Component\Validator\Tests\Constraints\ExpressionValidatorTest::testFailingExpressionAtNestedPropertyLevel()
File
- vendor/
symfony/ validator/ Tests/ Constraints/ ExpressionValidatorTest.php, line 150
Class
Namespace
Symfony\Component\Validator\Tests\ConstraintsCode
public function testFailingExpressionAtNestedPropertyLevel() {
$constraint = new Expression(array(
'expression' => 'value == this.data',
'message' => 'myMessage',
));
$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('2', $constraint);
$this
->buildViolation('myMessage')
->setParameter('{{ value }}', '"2"')
->atPath('reference.data')
->assertRaised();
}