You are here

public function ExpressionValidatorTest::testSucceedingExpressionAtPropertyLevel in Plug 7

File

lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/ExpressionValidatorTest.php, line 93

Class

ExpressionValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

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