Quellcode durchsuchen

[Validator] removed the convention that error parameters are delimited with %%

Fabien Potencier vor 14 Jahren
Ursprung
Commit
3b1e83380b
33 geänderte Dateien mit 70 neuen und 77 gelöschten Zeilen
  1. 1 8
      src/Symfony/Component/Validator/ConstraintViolation.php
  2. 2 2
      src/Symfony/Component/Validator/Constraints/AssertTypeValidator.php
  3. 1 1
      src/Symfony/Component/Validator/Constraints/BlankValidator.php
  4. 4 4
      src/Symfony/Component/Validator/Constraints/ChoiceValidator.php
  5. 2 2
      src/Symfony/Component/Validator/Constraints/CollectionValidator.php
  6. 1 1
      src/Symfony/Component/Validator/Constraints/DateTimeValidator.php
  7. 1 1
      src/Symfony/Component/Validator/Constraints/DateValidator.php
  8. 2 2
      src/Symfony/Component/Validator/Constraints/EmailValidator.php
  9. 8 8
      src/Symfony/Component/Validator/Constraints/FileValidator.php
  10. 2 2
      src/Symfony/Component/Validator/Constraints/MaxLengthValidator.php
  11. 2 2
      src/Symfony/Component/Validator/Constraints/MaxValidator.php
  12. 2 2
      src/Symfony/Component/Validator/Constraints/MinLengthValidator.php
  13. 2 2
      src/Symfony/Component/Validator/Constraints/MinValidator.php
  14. 1 1
      src/Symfony/Component/Validator/Constraints/NullValidator.php
  15. 1 1
      src/Symfony/Component/Validator/Constraints/RegexValidator.php
  16. 1 1
      src/Symfony/Component/Validator/Constraints/TimeValidator.php
  17. 1 1
      src/Symfony/Component/Validator/Constraints/UrlValidator.php
  18. 1 1
      src/Symfony/Component/Validator/Constraints/ValidValidator.php
  19. 2 2
      tests/Symfony/Tests/Component/Validator/Constraints/AssertTypeValidatorTest.php
  20. 1 1
      tests/Symfony/Tests/Component/Validator/Constraints/BlankValidatorTest.php
  21. 4 4
      tests/Symfony/Tests/Component/Validator/Constraints/ChoiceValidatorTest.php
  22. 1 1
      tests/Symfony/Tests/Component/Validator/Constraints/DateTimeValidatorTest.php
  23. 1 1
      tests/Symfony/Tests/Component/Validator/Constraints/DateValidatorTest.php
  24. 1 1
      tests/Symfony/Tests/Component/Validator/Constraints/EmailValidatorTest.php
  25. 13 13
      tests/Symfony/Tests/Component/Validator/Constraints/FileValidatorTest.php
  26. 2 2
      tests/Symfony/Tests/Component/Validator/Constraints/MaxLengthValidatorTest.php
  27. 2 2
      tests/Symfony/Tests/Component/Validator/Constraints/MaxValidatorTest.php
  28. 2 2
      tests/Symfony/Tests/Component/Validator/Constraints/MinLengthValidatorTest.php
  29. 2 2
      tests/Symfony/Tests/Component/Validator/Constraints/MinValidatorTest.php
  30. 1 1
      tests/Symfony/Tests/Component/Validator/Constraints/NullValidatorTest.php
  31. 1 1
      tests/Symfony/Tests/Component/Validator/Constraints/RegexValidatorTest.php
  32. 1 1
      tests/Symfony/Tests/Component/Validator/Constraints/TimeValidatorTest.php
  33. 1 1
      tests/Symfony/Tests/Component/Validator/Constraints/UrlValidatorTest.php

+ 1 - 8
src/Symfony/Component/Validator/ConstraintViolation.php

@@ -31,14 +31,7 @@ class ConstraintViolation
 
     public function getMessage()
     {
-        $sources = array();
-        $targets = array();
-        foreach ($this->messageParameters as $key => $value) {
-            $sources[] = '{{ '.$key.' }}';
-            $targets[] = (string) $value;
-        }
-
-        return str_replace($sources, $targets, $this->messageTemplate);
+        return str_replace(array_keys($sources), array_values($targets), $this->messageTemplate);
     }
 
     public function getRoot()

+ 2 - 2
src/Symfony/Component/Validator/Constraints/AssertTypeValidator.php

@@ -23,8 +23,8 @@ class AssertTypeValidator extends ConstraintValidator
         }
 
         $this->setMessage($constraint->message, array(
-            'value' => $value,
-            'type' => $constraint->type,
+            '{{ value }}' => $value,
+            '{{ type }}'  => $constraint->type,
         ));
 
         return false;

+ 1 - 1
src/Symfony/Component/Validator/Constraints/BlankValidator.php

@@ -10,7 +10,7 @@ class BlankValidator extends ConstraintValidator
     public function isValid($value, Constraint $constraint)
     {
         if ($value !== '' && $value !== null) {
-            $this->setMessage($constraint->message, array('value' => $value));
+            $this->setMessage($constraint->message, array('{{ value }}' => $value));
 
             return false;
         }

+ 4 - 4
src/Symfony/Component/Validator/Constraints/ChoiceValidator.php

@@ -53,7 +53,7 @@ class ChoiceValidator extends ConstraintValidator
         if ($constraint->multiple) {
             foreach ($value as $_value) {
                 if (!in_array($_value, $choices, true)) {
-                    $this->setMessage($constraint->message, array('value' => $_value));
+                    $this->setMessage($constraint->message, array('{{ value }}' => $_value));
 
                     return false;
                 }
@@ -62,18 +62,18 @@ class ChoiceValidator extends ConstraintValidator
             $count = count($value);
 
             if ($constraint->min !== null && $count < $constraint->min) {
-                $this->setMessage($constraint->minMessage, array('limit' => $constraint->min));
+                $this->setMessage($constraint->minMessage, array('{{ limit }}' => $constraint->min));
 
                 return false;
             }
 
             if ($constraint->max !== null && $count > $constraint->max) {
-                $this->setMessage($constraint->maxMessage, array('limit' => $constraint->max));
+                $this->setMessage($constraint->maxMessage, array('{{ limit }}' => $constraint->max));
 
                 return false;
             }
         } elseif (!in_array($value, $choices, true)) {
-            $this->setMessage($constraint->message, array('value' => $value));
+            $this->setMessage($constraint->message, array('{{ value }}' => $value));
 
             return false;
         }

+ 2 - 2
src/Symfony/Component/Validator/Constraints/CollectionValidator.php

@@ -48,7 +48,7 @@ class CollectionValidator extends ConstraintValidator
 
         if (count($extraFields) > 0 && !$constraint->allowExtraFields) {
             $this->setMessage($constraint->extraFieldsMessage, array(
-                'fields' => '"'.implode('", "', array_keys($extraFields)).'"'
+                '{{ fields }}' => '"'.implode('", "', array_keys($extraFields)).'"'
             ));
 
             return false;
@@ -56,7 +56,7 @@ class CollectionValidator extends ConstraintValidator
 
         if (count($missingFields) > 0 && !$constraint->allowMissingFields) {
             $this->setMessage($constraint->missingFieldsMessage, array(
-                'fields' => '"'.implode('", "', $missingFields).'"'
+                '{{ fields }}' => '"'.implode('", "', $missingFields).'"'
             ));
 
             return false;

+ 1 - 1
src/Symfony/Component/Validator/Constraints/DateTimeValidator.php

@@ -27,7 +27,7 @@ class DateTimeValidator extends ConstraintValidator
         $value = (string)$value;
 
         if (!preg_match(self::PATTERN, $value, $matches)) {
-            $this->setMessage($constraint->message, array('value' => $value));
+            $this->setMessage($constraint->message, array('{{ value }}' => $value));
 
             return false;
         }

+ 1 - 1
src/Symfony/Component/Validator/Constraints/DateValidator.php

@@ -23,7 +23,7 @@ class DateValidator extends ConstraintValidator
         $value = (string)$value;
 
         if (!preg_match(self::PATTERN, $value, $matches)) {
-            $this->setMessage($constraint->message, array('value' => $value));
+            $this->setMessage($constraint->message, array('{{ value }}' => $value));
 
             return false;
         }

+ 2 - 2
src/Symfony/Component/Validator/Constraints/EmailValidator.php

@@ -23,7 +23,7 @@ class EmailValidator extends ConstraintValidator
         $value = (string)$value;
 
         if (!preg_match(self::PATTERN, $value)) {
-            $this->setMessage($constraint->message, array('value' => $value));
+            $this->setMessage($constraint->message, array('{{ value }}' => $value));
 
             return false;
         }
@@ -32,7 +32,7 @@ class EmailValidator extends ConstraintValidator
             $host = substr($value, strpos($value, '@') + 1);
 
             if (!$this->checkMX($host)) {
-                $this->setMessage($constraint->message, array('value' => $value));
+                $this->setMessage($constraint->message, array('{{ value }}' => $value));
 
                 return false;
             }

+ 8 - 8
src/Symfony/Component/Validator/Constraints/FileValidator.php

@@ -27,13 +27,13 @@ class FileValidator extends ConstraintValidator
         $path = $value instanceof FileObject ? $value->getPath() : (string)$value;
 
         if (!file_exists($path)) {
-            $this->setMessage($constraint->notFoundMessage, array('file' => $path));
+            $this->setMessage($constraint->notFoundMessage, array('{{ file }}' => $path));
 
             return false;
         }
 
         if (!is_readable($path)) {
-            $this->setMessage($constraint->notReadableMessage, array('file' => $path));
+            $this->setMessage($constraint->notReadableMessage, array('{{ file }}' => $path));
 
             return false;
         }
@@ -57,9 +57,9 @@ class FileValidator extends ConstraintValidator
 
             if ($size > $limit) {
                 $this->setMessage($constraint->maxSizeMessage, array(
-                    'size' => $size . $suffix,
-                    'limit' => $limit . $suffix,
-                    'file' => $path,
+                    '{{ size }}' => $size . $suffix,
+                    '{{ limit }}' => $limit . $suffix,
+                    '{{ file }}' => $path,
                 ));
 
                 return false;
@@ -73,9 +73,9 @@ class FileValidator extends ConstraintValidator
 
             if (!in_array($value->getMimeType(), (array)$constraint->mimeTypes)) {
                 $this->setMessage($constraint->mimeTypesMessage, array(
-                    'type' => '"'.$value->getMimeType().'"',
-                    'types' => '"'.implode('", "', (array)$constraint->mimeTypes).'"',
-                    'file' => $path,
+                    '{{ type }}' => '"'.$value->getMimeType().'"',
+                    '{{ types }}' => '"'.implode('", "', (array)$constraint->mimeTypes).'"',
+                    '{{ file }}' => $path,
                 ));
 
                 return false;

+ 2 - 2
src/Symfony/Component/Validator/Constraints/MaxLengthValidator.php

@@ -24,8 +24,8 @@ class MaxLengthValidator extends ConstraintValidator
 
         if ($length > $constraint->limit) {
             $this->setMessage($constraint->message, array(
-                'value' => $value,
-                'limit' => $constraint->limit,
+                '{{ value }}' => $value,
+                '{{ limit }}' => $constraint->limit,
             ));
 
             return false;

+ 2 - 2
src/Symfony/Component/Validator/Constraints/MaxValidator.php

@@ -20,8 +20,8 @@ class MaxValidator extends ConstraintValidator
 
         if ($value > $constraint->limit) {
             $this->setMessage($constraint->message, array(
-                'value' => $value,
-                'limit' => $constraint->limit,
+                '{{ value }}' => $value,
+                '{{ limit }}' => $constraint->limit,
             ));
 
             return false;

+ 2 - 2
src/Symfony/Component/Validator/Constraints/MinLengthValidator.php

@@ -24,8 +24,8 @@ class MinLengthValidator extends ConstraintValidator
 
         if ($length < $constraint->limit) {
             $this->setMessage($constraint->message, array(
-                'value' => $value,
-                'limit' => $constraint->limit,
+                '{{ value }}' => $value,
+                '{{ limit }}' => $constraint->limit,
             ));
 
             return false;

+ 2 - 2
src/Symfony/Component/Validator/Constraints/MinValidator.php

@@ -20,8 +20,8 @@ class MinValidator extends ConstraintValidator
 
         if ($value < $constraint->limit) {
             $this->setMessage($constraint->message, array(
-                'value' => $value,
-                'limit' => $constraint->limit,
+                '{{ value }}' => $value,
+                '{{ limit }}' => $constraint->limit,
             ));
 
             return false;

+ 1 - 1
src/Symfony/Component/Validator/Constraints/NullValidator.php

@@ -10,7 +10,7 @@ class NullValidator extends ConstraintValidator
     public function isValid($value, Constraint $constraint)
     {
         if (!is_null($value)) {
-            $this->setMessage($constraint->message, array('value' => $value));
+            $this->setMessage($constraint->message, array('{{ value }}' => $value));
 
             return false;
         }

+ 1 - 1
src/Symfony/Component/Validator/Constraints/RegexValidator.php

@@ -26,7 +26,7 @@ class RegexValidator extends ConstraintValidator
             (!$constraint->match && preg_match($constraint->pattern, $value))
         )
         {
-            $this->setMessage($constraint->message, array('value' => $value));
+            $this->setMessage($constraint->message, array('{{ value }}' => $value));
 
             return false;
         }

+ 1 - 1
src/Symfony/Component/Validator/Constraints/TimeValidator.php

@@ -23,7 +23,7 @@ class TimeValidator extends ConstraintValidator
         $value = (string)$value;
 
         if (!preg_match(self::PATTERN, $value)) {
-            $this->setMessage($constraint->message, array('value' => $value));
+            $this->setMessage($constraint->message, array('{{ value }}' => $value));
 
             return false;
         }

+ 1 - 1
src/Symfony/Component/Validator/Constraints/UrlValidator.php

@@ -34,7 +34,7 @@ class UrlValidator extends ConstraintValidator
         $pattern = sprintf(self::PATTERN, implode('|', $constraint->protocols));
 
         if (!preg_match($pattern, $value)) {
-            $this->setMessage($constraint->message, array('value' => $value));
+            $this->setMessage($constraint->message, array('{{ value }}' => $value));
 
             return false;
         }

+ 1 - 1
src/Symfony/Component/Validator/Constraints/ValidValidator.php

@@ -27,7 +27,7 @@ class ValidValidator extends ConstraintValidator
         } else if (!is_object($value)) {
             throw new UnexpectedTypeException($value, 'object or array');
         } else if ($constraint->class && !$value instanceof $constraint->class) {
-            $this->setMessage($constraint->message, array('class' => $constraint->class));
+            $this->setMessage($constraint->message, array('{{ class }}' => $constraint->class));
 
             return false;
         } else {

+ 2 - 2
tests/Symfony/Tests/Component/Validator/Constraints/AssertTypeValidatorTest.php

@@ -101,8 +101,8 @@ class AssertTypeValidatorTest extends \PHPUnit_Framework_TestCase
         $this->assertFalse($this->validator->isValid('foobar', $constraint));
         $this->assertEquals($this->validator->getMessageTemplate(), 'myMessage');
         $this->assertEquals($this->validator->getMessageParameters(), array(
-            'value' => 'foobar',
-            'type' => 'numeric',
+            '{{ value }}' => 'foobar',
+            '{{ type }}' => 'numeric',
         ));
     }
 

+ 1 - 1
tests/Symfony/Tests/Component/Validator/Constraints/BlankValidatorTest.php

@@ -51,7 +51,7 @@ class BlankValidatorTest extends \PHPUnit_Framework_TestCase
         $this->assertFalse($this->validator->isValid('foobar', $constraint));
         $this->assertEquals($this->validator->getMessageTemplate(), 'myMessage');
         $this->assertEquals($this->validator->getMessageParameters(), array(
-            'value' => 'foobar',
+            '{{ value }}' => 'foobar',
         ));
     }
 }

+ 4 - 4
tests/Symfony/Tests/Component/Validator/Constraints/ChoiceValidatorTest.php

@@ -118,7 +118,7 @@ class ChoiceValidatorTest extends \PHPUnit_Framework_TestCase
         $this->assertFalse($this->validator->isValid('baz', $constraint));
         $this->assertEquals($this->validator->getMessageTemplate(), 'myMessage');
         $this->assertEquals($this->validator->getMessageParameters(), array(
-            'value' => 'baz',
+            '{{ value }}' => 'baz',
         ));
     }
 
@@ -133,7 +133,7 @@ class ChoiceValidatorTest extends \PHPUnit_Framework_TestCase
         $this->assertFalse($this->validator->isValid(array('foo', 'baz'), $constraint));
         $this->assertEquals($this->validator->getMessageTemplate(), 'myMessage');
         $this->assertEquals($this->validator->getMessageParameters(), array(
-            'value' => 'baz',
+            '{{ value }}' => 'baz',
         ));
     }
 
@@ -149,7 +149,7 @@ class ChoiceValidatorTest extends \PHPUnit_Framework_TestCase
         $this->assertFalse($this->validator->isValid(array('foo'), $constraint));
         $this->assertEquals($this->validator->getMessageTemplate(), 'myMessage');
         $this->assertEquals($this->validator->getMessageParameters(), array(
-            'limit' => 2,
+            '{{ limit }}' => 2,
         ));
     }
 
@@ -165,7 +165,7 @@ class ChoiceValidatorTest extends \PHPUnit_Framework_TestCase
         $this->assertFalse($this->validator->isValid(array('foo', 'bar', 'moo'), $constraint));
         $this->assertEquals($this->validator->getMessageTemplate(), 'myMessage');
         $this->assertEquals($this->validator->getMessageParameters(), array(
-            'limit' => 2,
+            '{{ limit }}' => 2,
         ));
     }
 }

+ 1 - 1
tests/Symfony/Tests/Component/Validator/Constraints/DateTimeValidatorTest.php

@@ -76,7 +76,7 @@ class DateTimeValidatorTest extends \PHPUnit_Framework_TestCase
         $this->assertFalse($this->validator->isValid('foobar', $constraint));
         $this->assertEquals($this->validator->getMessageTemplate(), 'myMessage');
         $this->assertEquals($this->validator->getMessageParameters(), array(
-            'value' => 'foobar',
+            '{{ value }}' => 'foobar',
         ));
     }
 }

+ 1 - 1
tests/Symfony/Tests/Component/Validator/Constraints/DateValidatorTest.php

@@ -70,7 +70,7 @@ class DateValidatorTest extends \PHPUnit_Framework_TestCase
         $this->assertFalse($this->validator->isValid('foobar', $constraint));
         $this->assertEquals($this->validator->getMessageTemplate(), 'myMessage');
         $this->assertEquals($this->validator->getMessageParameters(), array(
-            'value' => 'foobar',
+            '{{ value }}' => 'foobar',
         ));
     }
 }

+ 1 - 1
tests/Symfony/Tests/Component/Validator/Constraints/EmailValidatorTest.php

@@ -70,7 +70,7 @@ class EmailValidatorTest extends \PHPUnit_Framework_TestCase
         $this->assertFalse($this->validator->isValid('foobar', $constraint));
         $this->assertEquals($this->validator->getMessageTemplate(), 'myMessage');
         $this->assertEquals($this->validator->getMessageParameters(), array(
-            'value' => 'foobar',
+            '{{ value }}' => 'foobar',
         ));
     }
 }

+ 13 - 13
tests/Symfony/Tests/Component/Validator/Constraints/FileValidatorTest.php

@@ -52,9 +52,9 @@ class FileValidatorTest extends \PHPUnit_Framework_TestCase
         $this->assertFalse($this->validator->isValid($this->path, $constraint));
         $this->assertEquals($this->validator->getMessageTemplate(), 'myMessage');
         $this->assertEquals($this->validator->getMessageParameters(), array(
-            'limit' => '10 bytes',
-            'size' => '11 bytes',
-            'file' => $this->path,
+            '{{ limit }}' => '10 bytes',
+            '{{ size }}' => '11 bytes',
+            '{{ file }}' => $this->path,
         ));
     }
 
@@ -70,9 +70,9 @@ class FileValidatorTest extends \PHPUnit_Framework_TestCase
         $this->assertFalse($this->validator->isValid($this->path, $constraint));
         $this->assertEquals($this->validator->getMessageTemplate(), 'myMessage');
         $this->assertEquals($this->validator->getMessageParameters(), array(
-            'limit' => '1 kB',
-            'size' => '1.4 kB',
-            'file' => $this->path,
+            '{{ limit }}' => '1 kB',
+            '{{ size }}' => '1.4 kB',
+            '{{ file }}' => $this->path,
         ));
     }
 
@@ -88,9 +88,9 @@ class FileValidatorTest extends \PHPUnit_Framework_TestCase
         $this->assertFalse($this->validator->isValid($this->path, $constraint));
         $this->assertEquals($this->validator->getMessageTemplate(), 'myMessage');
         $this->assertEquals($this->validator->getMessageParameters(), array(
-            'limit' => '1 MB',
-            'size' => '1.4 MB',
-            'file' => $this->path,
+            '{{ limit }}' => '1 MB',
+            '{{ size }}' => '1.4 MB',
+            '{{ file }}' => $this->path,
         ));
     }
 
@@ -114,7 +114,7 @@ class FileValidatorTest extends \PHPUnit_Framework_TestCase
         $this->assertFalse($this->validator->isValid('foobar', $constraint));
         $this->assertEquals($this->validator->getMessageTemplate(), 'myMessage');
         $this->assertEquals($this->validator->getMessageParameters(), array(
-            'file' => 'foobar',
+            '{{ file }}' => 'foobar',
         ));
     }
 
@@ -153,9 +153,9 @@ class FileValidatorTest extends \PHPUnit_Framework_TestCase
         $this->assertFalse($this->validator->isValid($file, $constraint));
         $this->assertEquals($this->validator->getMessageTemplate(), 'myMessage');
         $this->assertEquals($this->validator->getMessageParameters(), array(
-            'type' => '"application/pdf"',
-            'types' => '"image/png", "image/jpg"',
-            'file' => $this->path,
+            '{{ type }}' => '"application/pdf"',
+            '{{ types }}' => '"image/png", "image/jpg"',
+            '{{ file }}' => $this->path,
         ));
     }
 }

+ 2 - 2
tests/Symfony/Tests/Component/Validator/Constraints/MaxLengthValidatorTest.php

@@ -78,8 +78,8 @@ class MaxLengthValidatorTest extends \PHPUnit_Framework_TestCase
         $this->assertFalse($this->validator->isValid('123456', $constraint));
         $this->assertEquals($this->validator->getMessageTemplate(), 'myMessage');
         $this->assertEquals($this->validator->getMessageParameters(), array(
-            'value' => '123456',
-            'limit' => 5,
+            '{{ value }}' => '123456',
+            '{{ limit }}' => 5,
         ));
     }
 }

+ 2 - 2
tests/Symfony/Tests/Component/Validator/Constraints/MaxValidatorTest.php

@@ -72,8 +72,8 @@ class MaxValidatorTest extends \PHPUnit_Framework_TestCase
         $this->assertFalse($this->validator->isValid(11, $constraint));
         $this->assertEquals($this->validator->getMessageTemplate(), 'myMessage');
         $this->assertEquals($this->validator->getMessageParameters(), array(
-            'value' => 11,
-            'limit' => 10,
+            '{{ value }}' => 11,
+            '{{ limit }}' => 10,
         ));
     }
 }

+ 2 - 2
tests/Symfony/Tests/Component/Validator/Constraints/MinLengthValidatorTest.php

@@ -78,8 +78,8 @@ class MinLengthValidatorTest extends \PHPUnit_Framework_TestCase
             $this->assertFalse($this->validator->isValid('1234', $constraint));
             $this->assertEquals($this->validator->getMessageTemplate(), 'myMessage');
             $this->assertEquals($this->validator->getMessageParameters(), array(
-            'value' => '1234',
-            'limit' => 5,
+            '{{ value }}' => '1234',
+            '{{ limit }}' => 5,
             ));
     }
 }

+ 2 - 2
tests/Symfony/Tests/Component/Validator/Constraints/MinValidatorTest.php

@@ -72,8 +72,8 @@ class MinValidatorTest extends \PHPUnit_Framework_TestCase
         $this->assertFalse($this->validator->isValid(9, $constraint));
         $this->assertEquals($this->validator->getMessageTemplate(), 'myMessage');
         $this->assertEquals($this->validator->getMessageParameters(), array(
-            'value' => 9,
-            'limit' => 10,
+            '{{ value }}' => 9,
+            '{{ limit }}' => 10,
         ));
     }
 }

+ 1 - 1
tests/Symfony/Tests/Component/Validator/Constraints/NullValidatorTest.php

@@ -46,7 +46,7 @@ class NullValidatorTest extends \PHPUnit_Framework_TestCase
         $this->assertFalse($this->validator->isValid(1, $constraint));
         $this->assertEquals($this->validator->getMessageTemplate(), 'myMessage');
         $this->assertEquals($this->validator->getMessageParameters(), array(
-            'value' => 1,
+            '{{ value }}' => 1,
         ));
     }
 }

+ 1 - 1
tests/Symfony/Tests/Component/Validator/Constraints/RegexValidatorTest.php

@@ -72,7 +72,7 @@ class RegexValidatorTest extends \PHPUnit_Framework_TestCase
         $this->assertFalse($this->validator->isValid('foobar', $constraint));
         $this->assertEquals($this->validator->getMessageTemplate(), 'myMessage');
         $this->assertEquals($this->validator->getMessageParameters(), array(
-            'value' => 'foobar',
+            '{{ value }}' => 'foobar',
         ));
     }
 }

+ 1 - 1
tests/Symfony/Tests/Component/Validator/Constraints/TimeValidatorTest.php

@@ -71,7 +71,7 @@ class TimeValidatorTest extends \PHPUnit_Framework_TestCase
         $this->assertFalse($this->validator->isValid('foobar', $constraint));
         $this->assertEquals($this->validator->getMessageTemplate(), 'myMessage');
         $this->assertEquals($this->validator->getMessageParameters(), array(
-            'value' => 'foobar',
+            '{{ value }}' => 'foobar',
         ));
     }
 }

+ 1 - 1
tests/Symfony/Tests/Component/Validator/Constraints/UrlValidatorTest.php

@@ -74,7 +74,7 @@ class UrlValidatorTest extends \PHPUnit_Framework_TestCase
         $this->assertFalse($this->validator->isValid('foobar', $constraint));
         $this->assertEquals($this->validator->getMessageTemplate(), 'myMessage');
         $this->assertEquals($this->validator->getMessageParameters(), array(
-            'value' => 'foobar',
+            '{{ value }}' => 'foobar',
         ));
     }
 }