You are here

public function ExpressionValidatorTest::testExpressionIsEvaluatedWithEmptyStringValue in Zircon Profile 8.0

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

File

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

Class

ExpressionValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

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