You are here

public function ExpressionValidatorTest::testExpressionIsEvaluatedWithNullValue 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::testExpressionIsEvaluatedWithNullValue()

File

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

Class

ExpressionValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testExpressionIsEvaluatedWithNullValue() {
  $constraint = new Expression(array(
    'expression' => 'false',
    'message' => 'myMessage',
  ));
  $this->validator
    ->validate(null, $constraint);
  $this
    ->buildViolation('myMessage')
    ->setParameter('{{ value }}', 'null')
    ->assertRaised();
}