You are here

public function ExpressionValidatorTest::testSucceedingExpressionAtObjectLevel in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Tests/Constraints/ExpressionValidatorTest.php \Symfony\Component\Validator\Tests\Constraints\ExpressionValidatorTest::testSucceedingExpressionAtObjectLevel()

File

vendor/symfony/validator/Tests/Constraints/ExpressionValidatorTest.php, line 60

Class

ExpressionValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testSucceedingExpressionAtObjectLevel() {
  $constraint = new Expression('this.data == 1');
  $object = new Entity();
  $object->data = '1';
  $this
    ->setObject($object);
  $this->validator
    ->validate($object, $constraint);
  $this
    ->assertNoViolation();
}