public function ExpressionValidatorTest::testFailingExpressionAtObjectLevel 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::testFailingExpressionAtObjectLevel()
File
- vendor/
symfony/ validator/ Tests/ Constraints/ ExpressionValidatorTest.php, line 74
Class
Namespace
Symfony\Component\Validator\Tests\ConstraintsCode
public function testFailingExpressionAtObjectLevel() {
$constraint = new Expression(array(
'expression' => 'this.data == 1',
'message' => 'myMessage',
));
$object = new Entity();
$object->data = '2';
$this
->setObject($object);
$this->validator
->validate($object, $constraint);
$this
->buildViolation('myMessage')
->setParameter('{{ value }}', 'object')
->assertRaised();
}