public function ExpressionValidatorTest::testFailingExpressionAtObjectLevel in Plug 7
File
- lib/
Symfony/ validator/ Symfony/ Component/ 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();
}