diff --git a/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php b/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php index 10ecbd88fb..023d82d339 100644 --- a/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php +++ b/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php @@ -41,7 +41,7 @@ class UniqueEntityValidator extends ConstraintValidator * @param object $entity * @param Constraint $constraint */ - public function isValid($entity, Constraint $constraint) + public function validate($entity, Constraint $constraint) { if (!is_array($constraint->fields) && !is_string($constraint->fields)) { throw new UnexpectedTypeException($constraint->fields, 'array'); diff --git a/src/Symfony/Bundle/SecurityBundle/Validator/Constraint/UserPasswordValidator.php b/src/Symfony/Bundle/SecurityBundle/Validator/Constraint/UserPasswordValidator.php index 355fb74a3e..a20d65dde2 100644 --- a/src/Symfony/Bundle/SecurityBundle/Validator/Constraint/UserPasswordValidator.php +++ b/src/Symfony/Bundle/SecurityBundle/Validator/Constraint/UserPasswordValidator.php @@ -29,7 +29,7 @@ class UserPasswordValidator extends ConstraintValidator $this->encoderFactory = $encoderFactory; } - public function isValid($password, Constraint $constraint) + public function validate($password, Constraint $constraint) { $user = $this->securityContext->getToken()->getUser(); diff --git a/src/Symfony/Component/Validator/ConstraintValidatorInterface.php b/src/Symfony/Component/Validator/ConstraintValidatorInterface.php index 99a99ffb59..6b287c663a 100644 --- a/src/Symfony/Component/Validator/ConstraintValidatorInterface.php +++ b/src/Symfony/Component/Validator/ConstraintValidatorInterface.php @@ -33,5 +33,5 @@ interface ConstraintValidatorInterface * * @api */ - function isValid($value, Constraint $constraint); + function validate($value, Constraint $constraint); } diff --git a/src/Symfony/Component/Validator/Constraints/AllValidator.php b/src/Symfony/Component/Validator/Constraints/AllValidator.php index fb9b65f6a9..d99d454ef0 100644 --- a/src/Symfony/Component/Validator/Constraints/AllValidator.php +++ b/src/Symfony/Component/Validator/Constraints/AllValidator.php @@ -30,7 +30,7 @@ class AllValidator extends ConstraintValidator * * @api */ - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if (null === $value) { return; diff --git a/src/Symfony/Component/Validator/Constraints/BlankValidator.php b/src/Symfony/Component/Validator/Constraints/BlankValidator.php index b57de12a9b..df6ecf2bd8 100644 --- a/src/Symfony/Component/Validator/Constraints/BlankValidator.php +++ b/src/Symfony/Component/Validator/Constraints/BlankValidator.php @@ -29,7 +29,7 @@ class BlankValidator extends ConstraintValidator * * @api */ - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if ('' !== $value && null !== $value) { $this->context->addViolation($constraint->message, array('{{ value }}' => $value)); diff --git a/src/Symfony/Component/Validator/Constraints/CallbackValidator.php b/src/Symfony/Component/Validator/Constraints/CallbackValidator.php index 1a11f35d42..5ff4555511 100644 --- a/src/Symfony/Component/Validator/Constraints/CallbackValidator.php +++ b/src/Symfony/Component/Validator/Constraints/CallbackValidator.php @@ -33,7 +33,7 @@ class CallbackValidator extends ConstraintValidator * * @api */ - public function isValid($object, Constraint $constraint) + public function validate($object, Constraint $constraint) { if (null === $object) { return; diff --git a/src/Symfony/Component/Validator/Constraints/ChoiceValidator.php b/src/Symfony/Component/Validator/Constraints/ChoiceValidator.php index 9976ae5ab4..2e3e18663e 100644 --- a/src/Symfony/Component/Validator/Constraints/ChoiceValidator.php +++ b/src/Symfony/Component/Validator/Constraints/ChoiceValidator.php @@ -35,7 +35,7 @@ class ChoiceValidator extends ConstraintValidator * * @api */ - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if (!$constraint->choices && !$constraint->callback) { throw new ConstraintDefinitionException('Either "choices" or "callback" must be specified on constraint Choice'); diff --git a/src/Symfony/Component/Validator/Constraints/CollectionValidator.php b/src/Symfony/Component/Validator/Constraints/CollectionValidator.php index a80c07be44..66fecd5fcf 100644 --- a/src/Symfony/Component/Validator/Constraints/CollectionValidator.php +++ b/src/Symfony/Component/Validator/Constraints/CollectionValidator.php @@ -32,7 +32,7 @@ class CollectionValidator extends ConstraintValidator * * @api */ - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if (null === $value) { return; diff --git a/src/Symfony/Component/Validator/Constraints/CountryValidator.php b/src/Symfony/Component/Validator/Constraints/CountryValidator.php index 75dbc3004b..c786ab74ba 100644 --- a/src/Symfony/Component/Validator/Constraints/CountryValidator.php +++ b/src/Symfony/Component/Validator/Constraints/CountryValidator.php @@ -32,7 +32,7 @@ class CountryValidator extends ConstraintValidator * * @api */ - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if (null === $value || '' === $value) { return; diff --git a/src/Symfony/Component/Validator/Constraints/DateValidator.php b/src/Symfony/Component/Validator/Constraints/DateValidator.php index 2a132ee99a..4888c99314 100644 --- a/src/Symfony/Component/Validator/Constraints/DateValidator.php +++ b/src/Symfony/Component/Validator/Constraints/DateValidator.php @@ -32,7 +32,7 @@ class DateValidator extends ConstraintValidator * * @api */ - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if (null === $value || '' === $value || $value instanceof \DateTime) { return; diff --git a/src/Symfony/Component/Validator/Constraints/EmailValidator.php b/src/Symfony/Component/Validator/Constraints/EmailValidator.php index 4d2b1e0860..e1e713e74c 100644 --- a/src/Symfony/Component/Validator/Constraints/EmailValidator.php +++ b/src/Symfony/Component/Validator/Constraints/EmailValidator.php @@ -30,7 +30,7 @@ class EmailValidator extends ConstraintValidator * * @api */ - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if (null === $value || '' === $value) { return; diff --git a/src/Symfony/Component/Validator/Constraints/FalseValidator.php b/src/Symfony/Component/Validator/Constraints/FalseValidator.php index 57919b65f6..370394880d 100644 --- a/src/Symfony/Component/Validator/Constraints/FalseValidator.php +++ b/src/Symfony/Component/Validator/Constraints/FalseValidator.php @@ -29,7 +29,7 @@ class FalseValidator extends ConstraintValidator * * @api */ - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if (null === $value || false === $value || 0 === $value || '0' === $value) { return; diff --git a/src/Symfony/Component/Validator/Constraints/FileValidator.php b/src/Symfony/Component/Validator/Constraints/FileValidator.php index a766250b83..3a0f311dd0 100644 --- a/src/Symfony/Component/Validator/Constraints/FileValidator.php +++ b/src/Symfony/Component/Validator/Constraints/FileValidator.php @@ -33,7 +33,7 @@ class FileValidator extends ConstraintValidator * * @api */ - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if (null === $value || '' === $value) { return; diff --git a/src/Symfony/Component/Validator/Constraints/ImageValidator.php b/src/Symfony/Component/Validator/Constraints/ImageValidator.php index 5708cb30de..ced333cbb7 100644 --- a/src/Symfony/Component/Validator/Constraints/ImageValidator.php +++ b/src/Symfony/Component/Validator/Constraints/ImageValidator.php @@ -22,15 +22,15 @@ use Symfony\Component\Validator\Exception\ConstraintDefinitionException; */ class ImageValidator extends FileValidator { - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { $violations = count($this->context->getViolations()); - parent::isValid($value, $constraint); + parent::validate($value, $constraint); - $isValid = count($this->context->getViolations()) === $violations; + $failed = count($this->context->getViolations()) !== $violations; - if (!$isValid || null === $value || '' === $value) { + if ($failed || null === $value || '' === $value) { return; } diff --git a/src/Symfony/Component/Validator/Constraints/IpValidator.php b/src/Symfony/Component/Validator/Constraints/IpValidator.php index 4195d3b1db..2f1503d036 100644 --- a/src/Symfony/Component/Validator/Constraints/IpValidator.php +++ b/src/Symfony/Component/Validator/Constraints/IpValidator.php @@ -33,7 +33,7 @@ class IpValidator extends ConstraintValidator * * @api */ - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if (null === $value || '' === $value) { return; diff --git a/src/Symfony/Component/Validator/Constraints/LanguageValidator.php b/src/Symfony/Component/Validator/Constraints/LanguageValidator.php index 12337b9704..3d74097385 100644 --- a/src/Symfony/Component/Validator/Constraints/LanguageValidator.php +++ b/src/Symfony/Component/Validator/Constraints/LanguageValidator.php @@ -32,7 +32,7 @@ class LanguageValidator extends ConstraintValidator * * @api */ - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if (null === $value || '' === $value) { return; diff --git a/src/Symfony/Component/Validator/Constraints/LocaleValidator.php b/src/Symfony/Component/Validator/Constraints/LocaleValidator.php index 639fbaa51f..3310fc655e 100644 --- a/src/Symfony/Component/Validator/Constraints/LocaleValidator.php +++ b/src/Symfony/Component/Validator/Constraints/LocaleValidator.php @@ -32,7 +32,7 @@ class LocaleValidator extends ConstraintValidator * * @api */ - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if (null === $value || '' === $value) { return; diff --git a/src/Symfony/Component/Validator/Constraints/MaxLengthValidator.php b/src/Symfony/Component/Validator/Constraints/MaxLengthValidator.php index 5425086c07..cb040ee42d 100644 --- a/src/Symfony/Component/Validator/Constraints/MaxLengthValidator.php +++ b/src/Symfony/Component/Validator/Constraints/MaxLengthValidator.php @@ -30,7 +30,7 @@ class MaxLengthValidator extends ConstraintValidator * * @api */ - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if (null === $value || '' === $value) { return; diff --git a/src/Symfony/Component/Validator/Constraints/MaxValidator.php b/src/Symfony/Component/Validator/Constraints/MaxValidator.php index 67256ed405..90c9437b2f 100644 --- a/src/Symfony/Component/Validator/Constraints/MaxValidator.php +++ b/src/Symfony/Component/Validator/Constraints/MaxValidator.php @@ -29,7 +29,7 @@ class MaxValidator extends ConstraintValidator * * @api */ - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if (null === $value) { return; diff --git a/src/Symfony/Component/Validator/Constraints/MinLengthValidator.php b/src/Symfony/Component/Validator/Constraints/MinLengthValidator.php index bc0da32fa0..5b3ea0c883 100644 --- a/src/Symfony/Component/Validator/Constraints/MinLengthValidator.php +++ b/src/Symfony/Component/Validator/Constraints/MinLengthValidator.php @@ -30,7 +30,7 @@ class MinLengthValidator extends ConstraintValidator * * @api */ - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if (null === $value || '' === $value) { return; diff --git a/src/Symfony/Component/Validator/Constraints/MinValidator.php b/src/Symfony/Component/Validator/Constraints/MinValidator.php index 1e059dd93b..4ffe43ab63 100644 --- a/src/Symfony/Component/Validator/Constraints/MinValidator.php +++ b/src/Symfony/Component/Validator/Constraints/MinValidator.php @@ -29,7 +29,7 @@ class MinValidator extends ConstraintValidator * * @api */ - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if (null === $value) { return; diff --git a/src/Symfony/Component/Validator/Constraints/NotBlankValidator.php b/src/Symfony/Component/Validator/Constraints/NotBlankValidator.php index 524bf345d7..5ca3f11a96 100644 --- a/src/Symfony/Component/Validator/Constraints/NotBlankValidator.php +++ b/src/Symfony/Component/Validator/Constraints/NotBlankValidator.php @@ -29,7 +29,7 @@ class NotBlankValidator extends ConstraintValidator * * @api */ - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if (false === $value || (empty($value) && '0' != $value)) { $this->context->addViolation($constraint->message); diff --git a/src/Symfony/Component/Validator/Constraints/NotNullValidator.php b/src/Symfony/Component/Validator/Constraints/NotNullValidator.php index 2a85c9f8e1..3015889529 100644 --- a/src/Symfony/Component/Validator/Constraints/NotNullValidator.php +++ b/src/Symfony/Component/Validator/Constraints/NotNullValidator.php @@ -29,7 +29,7 @@ class NotNullValidator extends ConstraintValidator * * @api */ - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if (null === $value) { $this->context->addViolation($constraint->message); diff --git a/src/Symfony/Component/Validator/Constraints/NullValidator.php b/src/Symfony/Component/Validator/Constraints/NullValidator.php index 731b06c1f3..febe97f924 100644 --- a/src/Symfony/Component/Validator/Constraints/NullValidator.php +++ b/src/Symfony/Component/Validator/Constraints/NullValidator.php @@ -29,7 +29,7 @@ class NullValidator extends ConstraintValidator * * @api */ - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if (null !== $value) { $this->context->addViolation($constraint->message, array('{{ value }}' => $value)); diff --git a/src/Symfony/Component/Validator/Constraints/RegexValidator.php b/src/Symfony/Component/Validator/Constraints/RegexValidator.php index 32cc37989b..283fe55958 100644 --- a/src/Symfony/Component/Validator/Constraints/RegexValidator.php +++ b/src/Symfony/Component/Validator/Constraints/RegexValidator.php @@ -33,7 +33,7 @@ class RegexValidator extends ConstraintValidator * * @api */ - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if (null === $value || '' === $value) { return; diff --git a/src/Symfony/Component/Validator/Constraints/SizeLengthValidator.php b/src/Symfony/Component/Validator/Constraints/SizeLengthValidator.php index 142f983117..04808f127b 100644 --- a/src/Symfony/Component/Validator/Constraints/SizeLengthValidator.php +++ b/src/Symfony/Component/Validator/Constraints/SizeLengthValidator.php @@ -28,7 +28,7 @@ class SizeLengthValidator extends ConstraintValidator * * @api */ - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if (null === $value || '' === $value) { return; diff --git a/src/Symfony/Component/Validator/Constraints/SizeValidator.php b/src/Symfony/Component/Validator/Constraints/SizeValidator.php index 0993657dd6..7ccbed737c 100644 --- a/src/Symfony/Component/Validator/Constraints/SizeValidator.php +++ b/src/Symfony/Component/Validator/Constraints/SizeValidator.php @@ -31,7 +31,7 @@ class SizeValidator extends ConstraintValidator * * @api */ - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if (null === $value) { return; diff --git a/src/Symfony/Component/Validator/Constraints/TimeValidator.php b/src/Symfony/Component/Validator/Constraints/TimeValidator.php index 03a33ba0c6..22c34bd673 100644 --- a/src/Symfony/Component/Validator/Constraints/TimeValidator.php +++ b/src/Symfony/Component/Validator/Constraints/TimeValidator.php @@ -32,7 +32,7 @@ class TimeValidator extends ConstraintValidator * * @api */ - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if (null === $value || '' === $value || $value instanceof \DateTime) { return; diff --git a/src/Symfony/Component/Validator/Constraints/TrueValidator.php b/src/Symfony/Component/Validator/Constraints/TrueValidator.php index 7a4ea25957..a40447425f 100644 --- a/src/Symfony/Component/Validator/Constraints/TrueValidator.php +++ b/src/Symfony/Component/Validator/Constraints/TrueValidator.php @@ -29,7 +29,7 @@ class TrueValidator extends ConstraintValidator * * @api */ - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if (null === $value) { return true; diff --git a/src/Symfony/Component/Validator/Constraints/TypeValidator.php b/src/Symfony/Component/Validator/Constraints/TypeValidator.php index 527258463f..c21d784f9f 100644 --- a/src/Symfony/Component/Validator/Constraints/TypeValidator.php +++ b/src/Symfony/Component/Validator/Constraints/TypeValidator.php @@ -29,7 +29,7 @@ class TypeValidator extends ConstraintValidator * * @api */ - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if (null === $value) { return; diff --git a/src/Symfony/Component/Validator/Constraints/UrlValidator.php b/src/Symfony/Component/Validator/Constraints/UrlValidator.php index 12b990d756..ca604f9897 100644 --- a/src/Symfony/Component/Validator/Constraints/UrlValidator.php +++ b/src/Symfony/Component/Validator/Constraints/UrlValidator.php @@ -45,7 +45,7 @@ class UrlValidator extends ConstraintValidator * * @api */ - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if (null === $value || '' === $value) { return; diff --git a/src/Symfony/Component/Validator/GraphWalker.php b/src/Symfony/Component/Validator/GraphWalker.php index ede0fa808d..ed7490cc9c 100644 --- a/src/Symfony/Component/Validator/GraphWalker.php +++ b/src/Symfony/Component/Validator/GraphWalker.php @@ -183,6 +183,6 @@ class GraphWalker ); $validator->initialize($localContext); - $validator->isValid($value, $constraint); + $validator->validate($value, $constraint); } } diff --git a/src/Symfony/Component/Validator/Tests/ConstraintValidatorTest.php b/src/Symfony/Component/Validator/Tests/ConstraintValidatorTest.php index b7a90d55c0..b9af1e9bea 100644 --- a/src/Symfony/Component/Validator/Tests/ConstraintValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/ConstraintValidatorTest.php @@ -25,7 +25,7 @@ class ConstraintValidatorTest_Validator extends ConstraintValidator $this->params = $params; } - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { $this->setMessage($this->message, $this->params); } @@ -44,7 +44,7 @@ class ConstraintValidatorTest extends \PHPUnit_Framework_TestCase ->method('addViolation') ->with('error message', array('foo' => 'bar')); - $validator->isValid('bam', $constraint); + $validator->validate('bam', $constraint); } /** @@ -55,6 +55,6 @@ class ConstraintValidatorTest extends \PHPUnit_Framework_TestCase $constraint = $this->getMock('Symfony\Component\Validator\Constraint', array(), array(), '', false); $validator = new ConstraintValidatorTest_Validator('error message', array('foo' => 'bar')); - $validator->isValid('bam', $constraint); + $validator->validate('bam', $constraint); } } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/AllValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/AllValidatorTest.php index 8022ab1002..ec4e6c5241 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/AllValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/AllValidatorTest.php @@ -54,7 +54,7 @@ class AllValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(null, new All(new Min(4))); + $this->validator->validate(null, new All(new Min(4))); } @@ -63,7 +63,7 @@ class AllValidatorTest extends \PHPUnit_Framework_TestCase */ public function testThrowsExceptionIfNotTraversable() { - $this->validator->isValid('foo.barbar', new All(new Min(4))); + $this->validator->validate('foo.barbar', new All(new Min(4))); } /** @@ -84,7 +84,7 @@ class AllValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid($array, new All($constraint)); + $this->validator->validate($array, new All($constraint)); } /** @@ -110,7 +110,7 @@ class AllValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid($array, new All($constraints)); + $this->validator->validate($array, new All($constraints)); } public function getValidArguments() diff --git a/src/Symfony/Component/Validator/Tests/Constraints/BlankValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/BlankValidatorTest.php index 502327544e..0fbe5e6fbb 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/BlankValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/BlankValidatorTest.php @@ -37,7 +37,7 @@ class BlankValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(null, new Blank()); + $this->validator->validate(null, new Blank()); } public function testBlankIsValid() @@ -45,7 +45,7 @@ class BlankValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid('', new Blank()); + $this->validator->validate('', new Blank()); } /** @@ -63,7 +63,7 @@ class BlankValidatorTest extends \PHPUnit_Framework_TestCase '{{ value }}' => $value, )); - $this->validator->isValid($value, $constraint); + $this->validator->validate($value, $constraint); } public function getInvalidValues() diff --git a/src/Symfony/Component/Validator/Tests/Constraints/CallbackValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/CallbackValidatorTest.php index 3d1b419315..269d5a2c01 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/CallbackValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/CallbackValidatorTest.php @@ -65,7 +65,7 @@ class CallbackValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(null, new Callback(array('foo'))); + $this->validator->validate(null, new Callback(array('foo'))); } public function testCallbackSingleMethod() @@ -79,7 +79,7 @@ class CallbackValidatorTest extends \PHPUnit_Framework_TestCase '{{ value }}' => 'foobar', )); - $this->validator->isValid($object, $constraint); + $this->validator->validate($object, $constraint); } public function testCallbackSingleStaticMethod() @@ -92,7 +92,7 @@ class CallbackValidatorTest extends \PHPUnit_Framework_TestCase '{{ value }}' => 'foobar', )); - $this->validator->isValid($object, new Callback(array( + $this->validator->validate($object, new Callback(array( array(__CLASS__.'_Class', 'validateStatic') ))); } @@ -113,7 +113,7 @@ class CallbackValidatorTest extends \PHPUnit_Framework_TestCase )); - $this->validator->isValid($object, new Callback(array( + $this->validator->validate($object, new Callback(array( 'validateOne', 'validateTwo' ))); } @@ -125,7 +125,7 @@ class CallbackValidatorTest extends \PHPUnit_Framework_TestCase { $object = new CallbackValidatorTest_Object(); - $this->validator->isValid($object, new Callback('foobar')); + $this->validator->validate($object, new Callback('foobar')); } /** @@ -135,7 +135,7 @@ class CallbackValidatorTest extends \PHPUnit_Framework_TestCase { $object = new CallbackValidatorTest_Object(); - $this->validator->isValid($object, new Callback(array('foobar'))); + $this->validator->validate($object, new Callback(array('foobar'))); } /** @@ -145,7 +145,7 @@ class CallbackValidatorTest extends \PHPUnit_Framework_TestCase { $object = new CallbackValidatorTest_Object(); - $this->validator->isValid($object, new Callback(array(array('foo', 'bar')))); + $this->validator->validate($object, new Callback(array(array('foo', 'bar')))); } public function testConstraintGetTargets() diff --git a/src/Symfony/Component/Validator/Tests/Constraints/ChoiceValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/ChoiceValidatorTest.php index 851e2ed21f..fd5b1dc0e9 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/ChoiceValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/ChoiceValidatorTest.php @@ -58,7 +58,7 @@ class ChoiceValidatorTest extends \PHPUnit_Framework_TestCase 'multiple' => true, )); - $this->validator->isValid('asdf', $constraint); + $this->validator->validate('asdf', $constraint); } public function testNullIsValid() @@ -66,7 +66,7 @@ class ChoiceValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(null, new Choice(array('choices' => array('foo', 'bar')))); + $this->validator->validate(null, new Choice(array('choices' => array('foo', 'bar')))); } /** @@ -74,7 +74,7 @@ class ChoiceValidatorTest extends \PHPUnit_Framework_TestCase */ public function testChoicesOrCallbackExpected() { - $this->validator->isValid('foobar', new Choice()); + $this->validator->validate('foobar', new Choice()); } /** @@ -82,7 +82,7 @@ class ChoiceValidatorTest extends \PHPUnit_Framework_TestCase */ public function testValidCallbackExpected() { - $this->validator->isValid('foobar', new Choice(array('callback' => 'abcd'))); + $this->validator->validate('foobar', new Choice(array('callback' => 'abcd'))); } public function testValidChoiceArray() @@ -92,7 +92,7 @@ class ChoiceValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid('bar', $constraint); + $this->validator->validate('bar', $constraint); } public function testValidChoiceCallbackFunction() @@ -102,7 +102,7 @@ class ChoiceValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid('bar', $constraint); + $this->validator->validate('bar', $constraint); } public function testValidChoiceCallbackClosure() @@ -114,7 +114,7 @@ class ChoiceValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid('bar', $constraint); + $this->validator->validate('bar', $constraint); } public function testValidChoiceCallbackStaticMethod() @@ -124,7 +124,7 @@ class ChoiceValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid('bar', $constraint); + $this->validator->validate('bar', $constraint); } public function testValidChoiceCallbackContextMethod() @@ -134,7 +134,7 @@ class ChoiceValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid('bar', $constraint); + $this->validator->validate('bar', $constraint); } public function testMultipleChoices() @@ -147,7 +147,7 @@ class ChoiceValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(array('baz', 'bar'), $constraint); + $this->validator->validate(array('baz', 'bar'), $constraint); } public function testInvalidChoice() @@ -163,7 +163,7 @@ class ChoiceValidatorTest extends \PHPUnit_Framework_TestCase '{{ value }}' => 'baz', ), null, null); - $this->validator->isValid('baz', $constraint); + $this->validator->validate('baz', $constraint); } public function testInvalidChoiceMultiple() @@ -180,7 +180,7 @@ class ChoiceValidatorTest extends \PHPUnit_Framework_TestCase '{{ value }}' => 'baz', )); - $this->validator->isValid(array('foo', 'baz'), $constraint); + $this->validator->validate(array('foo', 'baz'), $constraint); } public function testTooFewChoices() @@ -198,7 +198,7 @@ class ChoiceValidatorTest extends \PHPUnit_Framework_TestCase '{{ limit }}' => 2, ), null, 2); - $this->validator->isValid(array('foo'), $constraint); + $this->validator->validate(array('foo'), $constraint); } public function testTooManyChoices() @@ -216,7 +216,7 @@ class ChoiceValidatorTest extends \PHPUnit_Framework_TestCase '{{ limit }}' => 2, ), null, 2); - $this->validator->isValid(array('foo', 'bar', 'moo'), $constraint); + $this->validator->validate(array('foo', 'bar', 'moo'), $constraint); } public function testNonStrict() @@ -229,8 +229,8 @@ class ChoiceValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid('2', $constraint); - $this->validator->isValid(2, $constraint); + $this->validator->validate('2', $constraint); + $this->validator->validate(2, $constraint); } public function testStrictAllowsExactValue() @@ -243,7 +243,7 @@ class ChoiceValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(2, $constraint); + $this->validator->validate(2, $constraint); } public function testStrictDisallowsDifferentType() @@ -260,7 +260,7 @@ class ChoiceValidatorTest extends \PHPUnit_Framework_TestCase '{{ value }}' => '2', )); - $this->validator->isValid('2', $constraint); + $this->validator->validate('2', $constraint); } public function testNonStrictWithMultipleChoices() @@ -274,7 +274,7 @@ class ChoiceValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(array('2', 3), $constraint); + $this->validator->validate(array('2', 3), $constraint); } public function testStrictWithMultipleChoices() @@ -292,6 +292,6 @@ class ChoiceValidatorTest extends \PHPUnit_Framework_TestCase '{{ value }}' => '3', )); - $this->validator->isValid(array(2, '3'), $constraint); + $this->validator->validate(array(2, '3'), $constraint); } } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/CollectionValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/CollectionValidatorTest.php index d2495004e1..7af7993686 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/CollectionValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/CollectionValidatorTest.php @@ -58,7 +58,7 @@ abstract class CollectionValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolationAtSubPath'); - $this->validator->isValid(null, new Collection(array('fields' => array( + $this->validator->validate(null, new Collection(array('fields' => array( 'foo' => new Min(4), )))); } @@ -70,7 +70,7 @@ abstract class CollectionValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolationAtSubPath'); - $this->validator->isValid($data, new Collection(array( + $this->validator->validate($data, new Collection(array( 'foo' => new Min(4), ))); } @@ -80,7 +80,7 @@ abstract class CollectionValidatorTest extends \PHPUnit_Framework_TestCase */ public function testThrowsExceptionIfNotTraversable() { - $this->validator->isValid('foobar', new Collection(array('fields' => array( + $this->validator->validate('foobar', new Collection(array('fields' => array( 'foo' => new Min(4), )))); } @@ -106,7 +106,7 @@ abstract class CollectionValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolationAtSubPath'); - $this->validator->isValid($data, new Collection(array( + $this->validator->validate($data, new Collection(array( 'fields' => array( 'foo' => $constraint, 'bar' => $constraint, @@ -140,7 +140,7 @@ abstract class CollectionValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolationAtSubPath'); - $this->validator->isValid($data, new Collection(array( + $this->validator->validate($data, new Collection(array( 'fields' => array( 'foo' => $constraints, 'bar' => $constraints, @@ -161,7 +161,7 @@ abstract class CollectionValidatorTest extends \PHPUnit_Framework_TestCase '{{ field }}' => 'baz' )); - $this->validator->isValid($data, new Collection(array( + $this->validator->validate($data, new Collection(array( 'fields' => array( 'foo' => new Min(4), ), @@ -185,7 +185,7 @@ abstract class CollectionValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolationAtSubPath'); - $this->validator->isValid($data, $constraint); + $this->validator->validate($data, $constraint); } public function testExtraFieldsAllowed() @@ -205,7 +205,7 @@ abstract class CollectionValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolationAtSubPath'); - $this->validator->isValid($data, $constraint); + $this->validator->validate($data, $constraint); } public function testMissingFieldsDisallowed() @@ -225,7 +225,7 @@ abstract class CollectionValidatorTest extends \PHPUnit_Framework_TestCase '{{ field }}' => 'foo', )); - $this->validator->isValid($data, $constraint); + $this->validator->validate($data, $constraint); } public function testMissingFieldsAllowed() @@ -242,7 +242,7 @@ abstract class CollectionValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolationAtSubPath'); - $this->validator->isValid($data, $constraint); + $this->validator->validate($data, $constraint); } public function testOptionalFieldPresent() @@ -254,7 +254,7 @@ abstract class CollectionValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolationAtSubPath'); - $this->validator->isValid($data, new Collection(array( + $this->validator->validate($data, new Collection(array( 'foo' => new Optional(), ))); } @@ -266,7 +266,7 @@ abstract class CollectionValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolationAtSubPath'); - $this->validator->isValid($data, new Collection(array( + $this->validator->validate($data, new Collection(array( 'foo' => new Optional(), ))); } @@ -288,7 +288,7 @@ abstract class CollectionValidatorTest extends \PHPUnit_Framework_TestCase $data = $this->prepareTestData($array); - $this->validator->isValid($data, new Collection(array( + $this->validator->validate($data, new Collection(array( 'foo' => new Optional($constraint), ))); } @@ -315,7 +315,7 @@ abstract class CollectionValidatorTest extends \PHPUnit_Framework_TestCase $data = $this->prepareTestData($array); - $this->validator->isValid($data, new Collection(array( + $this->validator->validate($data, new Collection(array( 'foo' => new Optional($constraints), ))); } @@ -329,7 +329,7 @@ abstract class CollectionValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolationAtSubPath'); - $this->validator->isValid($data, new Collection(array( + $this->validator->validate($data, new Collection(array( 'foo' => new Required(), ))); } @@ -344,7 +344,7 @@ abstract class CollectionValidatorTest extends \PHPUnit_Framework_TestCase '{{ field }}' => 'foo', )); - $this->validator->isValid($data, new Collection(array( + $this->validator->validate($data, new Collection(array( 'fields' => array( 'foo' => new Required(), ), @@ -369,7 +369,7 @@ abstract class CollectionValidatorTest extends \PHPUnit_Framework_TestCase $data = $this->prepareTestData($array); - $this->validator->isValid($data, new Collection(array( + $this->validator->validate($data, new Collection(array( 'foo' => new Required($constraint), ))); } @@ -396,7 +396,7 @@ abstract class CollectionValidatorTest extends \PHPUnit_Framework_TestCase $data = $this->prepareTestData($array); - $this->validator->isValid($array, new Collection(array( + $this->validator->validate($array, new Collection(array( 'foo' => new Required($constraints), ))); } @@ -407,7 +407,7 @@ abstract class CollectionValidatorTest extends \PHPUnit_Framework_TestCase 'foo' => 3 )); - $this->validator->isValid($value, new Collection(array( + $this->validator->validate($value, new Collection(array( 'fields' => array( 'foo' => new Min(2), ) diff --git a/src/Symfony/Component/Validator/Tests/Constraints/CountryValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/CountryValidatorTest.php index 5345c698df..744f1247fd 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/CountryValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/CountryValidatorTest.php @@ -39,7 +39,7 @@ class CountryValidatorTest extends LocalizedTestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(null, new Country()); + $this->validator->validate(null, new Country()); } public function testEmptyStringIsValid() @@ -47,7 +47,7 @@ class CountryValidatorTest extends LocalizedTestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid('', new Country()); + $this->validator->validate('', new Country()); } /** @@ -55,7 +55,7 @@ class CountryValidatorTest extends LocalizedTestCase */ public function testExpectsStringCompatibleType() { - $this->validator->isValid(new \stdClass(), new Country()); + $this->validator->validate(new \stdClass(), new Country()); } /** @@ -70,7 +70,7 @@ class CountryValidatorTest extends LocalizedTestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid($country, new Country()); + $this->validator->validate($country, new Country()); } public function getValidCountries() @@ -101,7 +101,7 @@ class CountryValidatorTest extends LocalizedTestCase '{{ value }}' => $country, )); - $this->validator->isValid($country, $constraint); + $this->validator->validate($country, $constraint); } public function getInvalidCountries() diff --git a/src/Symfony/Component/Validator/Tests/Constraints/DateTimeValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/DateTimeValidatorTest.php index 3153caa10e..3263d6820a 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/DateTimeValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/DateTimeValidatorTest.php @@ -37,7 +37,7 @@ class DateTimeValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(null, new DateTime()); + $this->validator->validate(null, new DateTime()); } public function testEmptyStringIsValid() @@ -45,7 +45,7 @@ class DateTimeValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid('', new DateTime()); + $this->validator->validate('', new DateTime()); } public function testDateTimeClassIsValid() @@ -53,7 +53,7 @@ class DateTimeValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(new \DateTime(), new DateTime()); + $this->validator->validate(new \DateTime(), new DateTime()); } /** @@ -61,7 +61,7 @@ class DateTimeValidatorTest extends \PHPUnit_Framework_TestCase */ public function testExpectsStringCompatibleType() { - $this->validator->isValid(new \stdClass(), new DateTime()); + $this->validator->validate(new \stdClass(), new DateTime()); } /** @@ -72,7 +72,7 @@ class DateTimeValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid($dateTime, new DateTime()); + $this->validator->validate($dateTime, new DateTime()); } public function getValidDateTimes() @@ -99,7 +99,7 @@ class DateTimeValidatorTest extends \PHPUnit_Framework_TestCase '{{ value }}' => $dateTime, )); - $this->validator->isValid($dateTime, $constraint); + $this->validator->validate($dateTime, $constraint); } public function getInvalidDateTimes() diff --git a/src/Symfony/Component/Validator/Tests/Constraints/DateValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/DateValidatorTest.php index 5b34d461d8..007232c457 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/DateValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/DateValidatorTest.php @@ -37,7 +37,7 @@ class DateValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(null, new Date()); + $this->validator->validate(null, new Date()); } public function testEmptyStringIsValid() @@ -45,7 +45,7 @@ class DateValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid('', new Date()); + $this->validator->validate('', new Date()); } public function testDateTimeClassIsValid() @@ -53,7 +53,7 @@ class DateValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(new \DateTime(), new Date()); + $this->validator->validate(new \DateTime(), new Date()); } /** @@ -61,7 +61,7 @@ class DateValidatorTest extends \PHPUnit_Framework_TestCase */ public function testExpectsStringCompatibleType() { - $this->validator->isValid(new \stdClass(), new Date()); + $this->validator->validate(new \stdClass(), new Date()); } /** @@ -72,7 +72,7 @@ class DateValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid($date, new Date()); + $this->validator->validate($date, new Date()); } public function getValidDates() @@ -99,7 +99,7 @@ class DateValidatorTest extends \PHPUnit_Framework_TestCase '{{ value }}' => $date, )); - $this->validator->isValid($date, $constraint); + $this->validator->validate($date, $constraint); } public function getInvalidDates() diff --git a/src/Symfony/Component/Validator/Tests/Constraints/EmailValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/EmailValidatorTest.php index c5c8a97a93..f95c0899a9 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/EmailValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/EmailValidatorTest.php @@ -37,7 +37,7 @@ class EmailValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(null, new Email()); + $this->validator->validate(null, new Email()); } public function testEmptyStringIsValid() @@ -45,7 +45,7 @@ class EmailValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid('', new Email()); + $this->validator->validate('', new Email()); } /** @@ -53,7 +53,7 @@ class EmailValidatorTest extends \PHPUnit_Framework_TestCase */ public function testExpectsStringCompatibleType() { - $this->validator->isValid(new \stdClass(), new Email()); + $this->validator->validate(new \stdClass(), new Email()); } /** @@ -64,7 +64,7 @@ class EmailValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid($email, new Email()); + $this->validator->validate($email, new Email()); } public function getValidEmails() @@ -91,7 +91,7 @@ class EmailValidatorTest extends \PHPUnit_Framework_TestCase '{{ value }}' => $email, )); - $this->validator->isValid($email, $constraint); + $this->validator->validate($email, $constraint); } public function getInvalidEmails() diff --git a/src/Symfony/Component/Validator/Tests/Constraints/FalseValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/FalseValidatorTest.php index 90f9f17868..1bc16c20bd 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/FalseValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/FalseValidatorTest.php @@ -37,7 +37,7 @@ class FalseValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(null, new False()); + $this->validator->validate(null, new False()); } public function testFalseIsValid() @@ -45,7 +45,7 @@ class FalseValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(false, new False()); + $this->validator->validate(false, new False()); } public function testTrueIsInvalid() @@ -58,6 +58,6 @@ class FalseValidatorTest extends \PHPUnit_Framework_TestCase ->method('addViolation') ->with('myMessage', array()); - $this->validator->isValid(true, $constraint); + $this->validator->validate(true, $constraint); } } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/FileValidatorPathTest.php b/src/Symfony/Component/Validator/Tests/Constraints/FileValidatorPathTest.php index 0ef9197a03..c4b93cdcd3 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/FileValidatorPathTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/FileValidatorPathTest.php @@ -32,6 +32,6 @@ class FileValidatorPathTest extends FileValidatorTest '{{ file }}' => 'foobar', )); - $this->validator->isValid('foobar', $constraint); + $this->validator->validate('foobar', $constraint); } } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php index 2201c695a5..f7388dcebe 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php @@ -51,7 +51,7 @@ abstract class FileValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(null, new File()); + $this->validator->validate(null, new File()); } public function testEmptyStringIsValid() @@ -59,7 +59,7 @@ abstract class FileValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid('', new File()); + $this->validator->validate('', new File()); } /** @@ -67,7 +67,7 @@ abstract class FileValidatorTest extends \PHPUnit_Framework_TestCase */ public function testExpectsStringCompatibleTypeOrFile() { - $this->validator->isValid(new \stdClass(), new File()); + $this->validator->validate(new \stdClass(), new File()); } public function testValidFile() @@ -75,7 +75,7 @@ abstract class FileValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid($this->path, new File()); + $this->validator->validate($this->path, new File()); } public function testValidUploadedfile() @@ -84,7 +84,7 @@ abstract class FileValidatorTest extends \PHPUnit_Framework_TestCase ->method('addViolation'); $file = new UploadedFile($this->path, 'originalName'); - $this->validator->isValid($file, new File()); + $this->validator->validate($file, new File()); } public function testTooLargeBytes() @@ -104,7 +104,7 @@ abstract class FileValidatorTest extends \PHPUnit_Framework_TestCase '{{ file }}' => $this->path, )); - $this->validator->isValid($this->getFile($this->path), $constraint); + $this->validator->validate($this->getFile($this->path), $constraint); } public function testTooLargeKiloBytes() @@ -124,7 +124,7 @@ abstract class FileValidatorTest extends \PHPUnit_Framework_TestCase '{{ file }}' => $this->path, )); - $this->validator->isValid($this->getFile($this->path), $constraint); + $this->validator->validate($this->getFile($this->path), $constraint); } public function testTooLargeMegaBytes() @@ -144,7 +144,7 @@ abstract class FileValidatorTest extends \PHPUnit_Framework_TestCase '{{ file }}' => $this->path, )); - $this->validator->isValid($this->getFile($this->path), $constraint); + $this->validator->validate($this->getFile($this->path), $constraint); } /** @@ -156,7 +156,7 @@ abstract class FileValidatorTest extends \PHPUnit_Framework_TestCase 'maxSize' => '1abc', )); - $this->validator->isValid($this->path, $constraint); + $this->validator->validate($this->path, $constraint); } public function testValidMimeType() @@ -184,7 +184,7 @@ abstract class FileValidatorTest extends \PHPUnit_Framework_TestCase 'mimeTypes' => array('image/png', 'image/jpg'), )); - $this->validator->isValid($file, $constraint); + $this->validator->validate($file, $constraint); } public function testValidWildcardMimeType() @@ -212,7 +212,7 @@ abstract class FileValidatorTest extends \PHPUnit_Framework_TestCase 'mimeTypes' => array('image/*'), )); - $this->validator->isValid($file, $constraint); + $this->validator->validate($file, $constraint); } public function testInvalidMimeType() @@ -246,7 +246,7 @@ abstract class FileValidatorTest extends \PHPUnit_Framework_TestCase '{{ file }}' => $this->path, )); - $this->validator->isValid($file, $constraint); + $this->validator->validate($file, $constraint); } public function testInvalidWildcardMimeType() @@ -280,7 +280,7 @@ abstract class FileValidatorTest extends \PHPUnit_Framework_TestCase '{{ file }}' => $this->path, )); - $this->validator->isValid($file, $constraint); + $this->validator->validate($file, $constraint); } /** @@ -298,7 +298,7 @@ abstract class FileValidatorTest extends \PHPUnit_Framework_TestCase ->method('addViolation') ->with('myMessage', $params); - $this->validator->isValid($file, $constraint); + $this->validator->validate($file, $constraint); } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/ImageValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/ImageValidatorTest.php index 8029c2c41c..8854501624 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/ImageValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/ImageValidatorTest.php @@ -34,7 +34,7 @@ class ImageValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(null, new Image()); + $this->validator->validate(null, new Image()); } public function testEmptyStringIsValid() @@ -42,7 +42,7 @@ class ImageValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid('', new Image()); + $this->validator->validate('', new Image()); } public function testValidImage() @@ -54,7 +54,7 @@ class ImageValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid($this->image, new Image()); + $this->validator->validate($this->image, new Image()); } public function testValidSize() @@ -73,7 +73,7 @@ class ImageValidatorTest extends \PHPUnit_Framework_TestCase 'maxHeight' => 2, )); - $this->validator->isValid($this->image, $constraint); + $this->validator->validate($this->image, $constraint); } public function testWidthTooSmall() @@ -94,7 +94,7 @@ class ImageValidatorTest extends \PHPUnit_Framework_TestCase '{{ min_width }}' => '3', )); - $this->validator->isValid($this->image, $constraint); + $this->validator->validate($this->image, $constraint); } public function testWidthTooBig() @@ -115,7 +115,7 @@ class ImageValidatorTest extends \PHPUnit_Framework_TestCase '{{ max_width }}' => '1', )); - $this->validator->isValid($this->image, $constraint); + $this->validator->validate($this->image, $constraint); } public function testHeightTooSmall() @@ -136,7 +136,7 @@ class ImageValidatorTest extends \PHPUnit_Framework_TestCase '{{ min_height }}' => '3', )); - $this->validator->isValid($this->image, $constraint); + $this->validator->validate($this->image, $constraint); } public function testHeightTooBig() @@ -157,7 +157,7 @@ class ImageValidatorTest extends \PHPUnit_Framework_TestCase '{{ max_height }}' => '1', )); - $this->validator->isValid($this->image, $constraint); + $this->validator->validate($this->image, $constraint); } /** @@ -173,7 +173,7 @@ class ImageValidatorTest extends \PHPUnit_Framework_TestCase 'minWidth' => '1abc', )); - $this->validator->isValid($this->image, $constraint); + $this->validator->validate($this->image, $constraint); } /** @@ -189,7 +189,7 @@ class ImageValidatorTest extends \PHPUnit_Framework_TestCase 'maxWidth' => '1abc', )); - $this->validator->isValid($this->image, $constraint); + $this->validator->validate($this->image, $constraint); } /** @@ -205,7 +205,7 @@ class ImageValidatorTest extends \PHPUnit_Framework_TestCase 'minHeight' => '1abc', )); - $this->validator->isValid($this->image, $constraint); + $this->validator->validate($this->image, $constraint); } /** @@ -221,6 +221,6 @@ class ImageValidatorTest extends \PHPUnit_Framework_TestCase 'maxHeight' => '1abc', )); - $this->validator->isValid($this->image, $constraint); + $this->validator->validate($this->image, $constraint); } } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/IpValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/IpValidatorTest.php index 0ee24a8952..74293184c1 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/IpValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/IpValidatorTest.php @@ -37,7 +37,7 @@ class IpValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(null, new Ip()); + $this->validator->validate(null, new Ip()); } public function testEmptyStringIsValid() @@ -45,7 +45,7 @@ class IpValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid('', new Ip()); + $this->validator->validate('', new Ip()); } /** @@ -53,7 +53,7 @@ class IpValidatorTest extends \PHPUnit_Framework_TestCase */ public function testExpectsStringCompatibleType() { - $this->validator->isValid(new \stdClass(), new Ip()); + $this->validator->validate(new \stdClass(), new Ip()); } /** @@ -74,7 +74,7 @@ class IpValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid($ip, new Ip(array( + $this->validator->validate($ip, new Ip(array( 'version' => Ip::V4, ))); } @@ -101,7 +101,7 @@ class IpValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid($ip, new Ip(array( + $this->validator->validate($ip, new Ip(array( 'version' => Ip::V6, ))); } @@ -139,7 +139,7 @@ class IpValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid($ip, new Ip(array( + $this->validator->validate($ip, new Ip(array( 'version' => Ip::ALL, ))); } @@ -165,7 +165,7 @@ class IpValidatorTest extends \PHPUnit_Framework_TestCase '{{ value }}' => $ip, )); - $this->validator->isValid($ip, $constraint); + $this->validator->validate($ip, $constraint); } public function getInvalidIpsV4() @@ -199,7 +199,7 @@ class IpValidatorTest extends \PHPUnit_Framework_TestCase '{{ value }}' => $ip, )); - $this->validator->isValid($ip, $constraint); + $this->validator->validate($ip, $constraint); } public function getInvalidPrivateIpsV4() @@ -227,7 +227,7 @@ class IpValidatorTest extends \PHPUnit_Framework_TestCase '{{ value }}' => $ip, )); - $this->validator->isValid($ip, $constraint); + $this->validator->validate($ip, $constraint); } public function getInvalidReservedIpsV4() @@ -255,7 +255,7 @@ class IpValidatorTest extends \PHPUnit_Framework_TestCase '{{ value }}' => $ip, )); - $this->validator->isValid($ip, $constraint); + $this->validator->validate($ip, $constraint); } public function getInvalidPublicIpsV4() @@ -279,7 +279,7 @@ class IpValidatorTest extends \PHPUnit_Framework_TestCase '{{ value }}' => $ip, )); - $this->validator->isValid($ip, $constraint); + $this->validator->validate($ip, $constraint); } public function getInvalidIpsV6() @@ -317,7 +317,7 @@ class IpValidatorTest extends \PHPUnit_Framework_TestCase '{{ value }}' => $ip, )); - $this->validator->isValid($ip, $constraint); + $this->validator->validate($ip, $constraint); } public function getInvalidPrivateIpsV6() @@ -345,7 +345,7 @@ class IpValidatorTest extends \PHPUnit_Framework_TestCase '{{ value }}' => $ip, )); - $this->validator->isValid($ip, $constraint); + $this->validator->validate($ip, $constraint); } public function getInvalidReservedIpsV6() @@ -372,7 +372,7 @@ class IpValidatorTest extends \PHPUnit_Framework_TestCase '{{ value }}' => $ip, )); - $this->validator->isValid($ip, $constraint); + $this->validator->validate($ip, $constraint); } public function getInvalidPublicIpsV6() @@ -396,7 +396,7 @@ class IpValidatorTest extends \PHPUnit_Framework_TestCase '{{ value }}' => $ip, )); - $this->validator->isValid($ip, $constraint); + $this->validator->validate($ip, $constraint); } public function getInvalidIpsAll() @@ -420,7 +420,7 @@ class IpValidatorTest extends \PHPUnit_Framework_TestCase '{{ value }}' => $ip, )); - $this->validator->isValid($ip, $constraint); + $this->validator->validate($ip, $constraint); } public function getInvalidPrivateIpsAll() @@ -444,7 +444,7 @@ class IpValidatorTest extends \PHPUnit_Framework_TestCase '{{ value }}' => $ip, )); - $this->validator->isValid($ip, $constraint); + $this->validator->validate($ip, $constraint); } public function getInvalidReservedIpsAll() @@ -468,7 +468,7 @@ class IpValidatorTest extends \PHPUnit_Framework_TestCase '{{ value }}' => $ip, )); - $this->validator->isValid($ip, $constraint); + $this->validator->validate($ip, $constraint); } public function getInvalidPublicIpsAll() diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LanguageValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LanguageValidatorTest.php index 1c7438c51f..4f06afab91 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/LanguageValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/LanguageValidatorTest.php @@ -39,7 +39,7 @@ class LanguageValidatorTest extends LocalizedTestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(null, new Language()); + $this->validator->validate(null, new Language()); } public function testEmptyStringIsValid() @@ -47,7 +47,7 @@ class LanguageValidatorTest extends LocalizedTestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid('', new Language()); + $this->validator->validate('', new Language()); } /** @@ -55,7 +55,7 @@ class LanguageValidatorTest extends LocalizedTestCase */ public function testExpectsStringCompatibleType() { - $this->validator->isValid(new \stdClass(), new Language()); + $this->validator->validate(new \stdClass(), new Language()); } /** @@ -70,7 +70,7 @@ class LanguageValidatorTest extends LocalizedTestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid($language, new Language()); + $this->validator->validate($language, new Language()); } public function getValidLanguages() @@ -101,7 +101,7 @@ class LanguageValidatorTest extends LocalizedTestCase '{{ value }}' => $language, )); - $this->validator->isValid($language, $constraint); + $this->validator->validate($language, $constraint); } public function getInvalidLanguages() diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LocaleValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LocaleValidatorTest.php index 5f150df193..bb5e944c3f 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/LocaleValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/LocaleValidatorTest.php @@ -39,7 +39,7 @@ class LocaleValidatorTest extends LocalizedTestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(null, new Locale()); + $this->validator->validate(null, new Locale()); } public function testEmptyStringIsValid() @@ -47,7 +47,7 @@ class LocaleValidatorTest extends LocalizedTestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid('', new Locale()); + $this->validator->validate('', new Locale()); } /** @@ -55,7 +55,7 @@ class LocaleValidatorTest extends LocalizedTestCase */ public function testExpectsStringCompatibleType() { - $this->validator->isValid(new \stdClass(), new Locale()); + $this->validator->validate(new \stdClass(), new Locale()); } /** @@ -70,7 +70,7 @@ class LocaleValidatorTest extends LocalizedTestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid($locale, new Locale()); + $this->validator->validate($locale, new Locale()); } public function getValidLocales() @@ -102,7 +102,7 @@ class LocaleValidatorTest extends LocalizedTestCase '{{ value }}' => $locale, )); - $this->validator->isValid($locale, $constraint); + $this->validator->validate($locale, $constraint); } public function getInvalidLocales() diff --git a/src/Symfony/Component/Validator/Tests/Constraints/MaxLengthValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/MaxLengthValidatorTest.php index 5e61aded08..c68e3cc93f 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/MaxLengthValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/MaxLengthValidatorTest.php @@ -37,7 +37,7 @@ class MaxLengthValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(null, new MaxLength(array('limit' => 5))); + $this->validator->validate(null, new MaxLength(array('limit' => 5))); } public function testEmptyStringIsValid() @@ -45,7 +45,7 @@ class MaxLengthValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid('', new MaxLength(array('limit' => 5))); + $this->validator->validate('', new MaxLength(array('limit' => 5))); } /** @@ -53,7 +53,7 @@ class MaxLengthValidatorTest extends \PHPUnit_Framework_TestCase */ public function testExpectsStringCompatibleType() { - $this->validator->isValid(new \stdClass(), new MaxLength(array('limit' => 5))); + $this->validator->validate(new \stdClass(), new MaxLength(array('limit' => 5))); } /** @@ -69,7 +69,7 @@ class MaxLengthValidatorTest extends \PHPUnit_Framework_TestCase ->method('addViolation'); $constraint = new MaxLength(array('limit' => 5)); - $this->validator->isValid($value, $constraint); + $this->validator->validate($value, $constraint); } public function getValidValues() @@ -103,7 +103,7 @@ class MaxLengthValidatorTest extends \PHPUnit_Framework_TestCase '{{ limit }}' => 5, ), null, 5); - $this->validator->isValid($value, $constraint); + $this->validator->validate($value, $constraint); } public function getInvalidValues() diff --git a/src/Symfony/Component/Validator/Tests/Constraints/MaxValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/MaxValidatorTest.php index bbb5a4d574..f86b5109d8 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/MaxValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/MaxValidatorTest.php @@ -37,7 +37,7 @@ class MaxValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(null, new Max(array('limit' => 10))); + $this->validator->validate(null, new Max(array('limit' => 10))); } /** @@ -49,7 +49,7 @@ class MaxValidatorTest extends \PHPUnit_Framework_TestCase ->method('addViolation'); $constraint = new Max(array('limit' => 10)); - $this->validator->isValid($value, $constraint); + $this->validator->validate($value, $constraint); } public function getValidValues() @@ -80,7 +80,7 @@ class MaxValidatorTest extends \PHPUnit_Framework_TestCase '{{ limit }}' => 10, )); - $this->validator->isValid($value, $constraint); + $this->validator->validate($value, $constraint); } public function getInvalidValues() diff --git a/src/Symfony/Component/Validator/Tests/Constraints/MinLengthValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/MinLengthValidatorTest.php index 4488b6ddef..a3c0d618f8 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/MinLengthValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/MinLengthValidatorTest.php @@ -37,7 +37,7 @@ class MinLengthValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(null, new MinLength(array('limit' => 6))); + $this->validator->validate(null, new MinLength(array('limit' => 6))); } public function testEmptyStringIsValid() @@ -45,7 +45,7 @@ class MinLengthValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid('', new MinLength(array('limit' => 6))); + $this->validator->validate('', new MinLength(array('limit' => 6))); } /** @@ -53,7 +53,7 @@ class MinLengthValidatorTest extends \PHPUnit_Framework_TestCase */ public function testExpectsStringCompatibleType() { - $this->validator->isValid(new \stdClass(), new MinLength(array('limit' => 5))); + $this->validator->validate(new \stdClass(), new MinLength(array('limit' => 5))); } /** @@ -69,7 +69,7 @@ class MinLengthValidatorTest extends \PHPUnit_Framework_TestCase ->method('addViolation'); $constraint = new MinLength(array('limit' => 6)); - $this->validator->isValid($value, $constraint); + $this->validator->validate($value, $constraint); } public function getValidValues() @@ -103,7 +103,7 @@ class MinLengthValidatorTest extends \PHPUnit_Framework_TestCase '{{ limit }}' => 5, ), null, 5); - $this->validator->isValid($value, $constraint); + $this->validator->validate($value, $constraint); } public function getInvalidValues() diff --git a/src/Symfony/Component/Validator/Tests/Constraints/MinValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/MinValidatorTest.php index 4bcb831d9e..fb103ce983 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/MinValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/MinValidatorTest.php @@ -31,7 +31,7 @@ class MinValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(null, new Min(array('limit' => 10))); + $this->validator->validate(null, new Min(array('limit' => 10))); } /** @@ -43,7 +43,7 @@ class MinValidatorTest extends \PHPUnit_Framework_TestCase ->method('addViolation'); $constraint = new Min(array('limit' => 10)); - $this->validator->isValid($value, $constraint); + $this->validator->validate($value, $constraint); } public function getValidValues() @@ -74,7 +74,7 @@ class MinValidatorTest extends \PHPUnit_Framework_TestCase '{{ limit }}' => 10, )); - $this->validator->isValid($value, $constraint); + $this->validator->validate($value, $constraint); } public function getInvalidValues() diff --git a/src/Symfony/Component/Validator/Tests/Constraints/NotBlankValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/NotBlankValidatorTest.php index ce9febbc40..0e4401e4c4 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/NotBlankValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/NotBlankValidatorTest.php @@ -40,7 +40,7 @@ class NotBlankValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid($date, new NotBlank()); + $this->validator->validate($date, new NotBlank()); } public function getValidValues() @@ -64,7 +64,7 @@ class NotBlankValidatorTest extends \PHPUnit_Framework_TestCase ->method('addViolation') ->with('myMessage'); - $this->validator->isValid(null, $constraint); + $this->validator->validate(null, $constraint); } public function testBlankIsInvalid() @@ -77,7 +77,7 @@ class NotBlankValidatorTest extends \PHPUnit_Framework_TestCase ->method('addViolation') ->with('myMessage'); - $this->validator->isValid('', $constraint); + $this->validator->validate('', $constraint); } public function testFalseIsInvalid() @@ -90,7 +90,7 @@ class NotBlankValidatorTest extends \PHPUnit_Framework_TestCase ->method('addViolation') ->with('myMessage'); - $this->validator->isValid(false, $constraint); + $this->validator->validate(false, $constraint); } public function testEmptyArrayIsInvalid() @@ -103,7 +103,7 @@ class NotBlankValidatorTest extends \PHPUnit_Framework_TestCase ->method('addViolation') ->with('myMessage'); - $this->validator->isValid(array(), $constraint); + $this->validator->validate(array(), $constraint); } } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/NotNullValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/NotNullValidatorTest.php index 03c79b63ec..96f74a1ba0 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/NotNullValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/NotNullValidatorTest.php @@ -40,7 +40,7 @@ class NotNullValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid($value, new NotNull()); + $this->validator->validate($value, new NotNull()); } public function getValidValues() @@ -64,6 +64,6 @@ class NotNullValidatorTest extends \PHPUnit_Framework_TestCase ->with('myMessage', array( )); - $this->validator->isValid(null, $constraint); + $this->validator->validate(null, $constraint); } } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/NullValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/NullValidatorTest.php index f098f3d62a..4466aa17c9 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/NullValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/NullValidatorTest.php @@ -37,7 +37,7 @@ class NullValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(null, new Null()); + $this->validator->validate(null, new Null()); } /** @@ -55,7 +55,7 @@ class NullValidatorTest extends \PHPUnit_Framework_TestCase '{{ value }}' => $value, )); - $this->validator->isValid($value, $constraint); + $this->validator->validate($value, $constraint); } public function getInvalidValues() diff --git a/src/Symfony/Component/Validator/Tests/Constraints/RegexValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/RegexValidatorTest.php index fcc27dc62e..755f488577 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/RegexValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/RegexValidatorTest.php @@ -37,7 +37,7 @@ class RegexValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(null, new Regex(array('pattern' => '/^[0-9]+$/'))); + $this->validator->validate(null, new Regex(array('pattern' => '/^[0-9]+$/'))); } public function testEmptyStringIsValid() @@ -45,7 +45,7 @@ class RegexValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid('', new Regex(array('pattern' => '/^[0-9]+$/'))); + $this->validator->validate('', new Regex(array('pattern' => '/^[0-9]+$/'))); } /** @@ -53,7 +53,7 @@ class RegexValidatorTest extends \PHPUnit_Framework_TestCase */ public function testExpectsStringCompatibleType() { - $this->validator->isValid(new \stdClass(), new Regex(array('pattern' => '/^[0-9]+$/'))); + $this->validator->validate(new \stdClass(), new Regex(array('pattern' => '/^[0-9]+$/'))); } /** @@ -65,7 +65,7 @@ class RegexValidatorTest extends \PHPUnit_Framework_TestCase ->method('addViolation'); $constraint = new Regex(array('pattern' => '/^[0-9]+$/')); - $this->validator->isValid($value, $constraint); + $this->validator->validate($value, $constraint); } public function getValidValues() @@ -94,7 +94,7 @@ class RegexValidatorTest extends \PHPUnit_Framework_TestCase '{{ value }}' => $value, )); - $this->validator->isValid($value, $constraint); + $this->validator->validate($value, $constraint); } public function getInvalidValues() diff --git a/src/Symfony/Component/Validator/Tests/Constraints/SizeLengthValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/SizeLengthValidatorTest.php index b8c2d20440..eddf9475cf 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/SizeLengthValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/SizeLengthValidatorTest.php @@ -37,7 +37,7 @@ class SizeLengthValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(null, new SizeLength(array('min' => 6, 'max' => 10))); + $this->validator->validate(null, new SizeLength(array('min' => 6, 'max' => 10))); } public function testEmptyStringIsValid() @@ -45,7 +45,7 @@ class SizeLengthValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid('', new SizeLength(array('min' => 6, 'max' => 10))); + $this->validator->validate('', new SizeLength(array('min' => 6, 'max' => 10))); } /** @@ -53,7 +53,7 @@ class SizeLengthValidatorTest extends \PHPUnit_Framework_TestCase */ public function testExpectsStringCompatibleType() { - $this->validator->isValid(new \stdClass(), new SizeLength(array('min' => 6, 'max' => 10))); + $this->validator->validate(new \stdClass(), new SizeLength(array('min' => 6, 'max' => 10))); } /** @@ -69,7 +69,7 @@ class SizeLengthValidatorTest extends \PHPUnit_Framework_TestCase ->method('addViolation'); $constraint = new SizeLength(array('min' => 6, 'max' => 10)); - $this->validator->isValid($value, $constraint); + $this->validator->validate($value, $constraint); } public function getValidValues() @@ -99,7 +99,7 @@ class SizeLengthValidatorTest extends \PHPUnit_Framework_TestCase ->method('addViolation'); $constraint = new SizeLength(array('min' => 6, 'max' => 10)); - $this->validator->isValid($value, $constraint); + $this->validator->validate($value, $constraint); } public function getInvalidValues() @@ -131,7 +131,7 @@ class SizeLengthValidatorTest extends \PHPUnit_Framework_TestCase '{{ limit }}' => 5, ), null, 5); - $this->validator->isValid('1234', $constraint); + $this->validator->validate('1234', $constraint); } public function testMaxMessageIsSet() @@ -149,7 +149,7 @@ class SizeLengthValidatorTest extends \PHPUnit_Framework_TestCase '{{ limit }}' => 10, ), null, 10); - $this->validator->isValid('12345678901', $constraint); + $this->validator->validate('12345678901', $constraint); } public function testExactMessageIsSet() @@ -167,6 +167,6 @@ class SizeLengthValidatorTest extends \PHPUnit_Framework_TestCase '{{ limit }}' => 5, ), null, 5); - $this->validator->isValid('1234', $constraint); + $this->validator->validate('1234', $constraint); } } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/SizeValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/SizeValidatorTest.php index 0b6099d47c..5cda166f48 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/SizeValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/SizeValidatorTest.php @@ -31,7 +31,7 @@ class SizeValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(null, new Size(array('min' => 10, 'max' => 20))); + $this->validator->validate(null, new Size(array('min' => 10, 'max' => 20))); } /** @@ -43,7 +43,7 @@ class SizeValidatorTest extends \PHPUnit_Framework_TestCase ->method('addViolation'); $constraint = new Size(array('min' => 10, 'max' => 20)); - $this->validator->isValid($value, $constraint); + $this->validator->validate($value, $constraint); } public function getValidValues() @@ -69,7 +69,7 @@ class SizeValidatorTest extends \PHPUnit_Framework_TestCase ->method('addViolation'); $constraint = new Size(array('min' => 10, 'max' => 20)); - $this->validator->isValid($value, $constraint); + $this->validator->validate($value, $constraint); } public function getInvalidValues() @@ -98,7 +98,7 @@ class SizeValidatorTest extends \PHPUnit_Framework_TestCase '{{ limit }}' => 10, )); - $this->validator->isValid(9, $constraint); + $this->validator->validate(9, $constraint); } public function testMaxMessageIsSet() @@ -116,6 +116,6 @@ class SizeValidatorTest extends \PHPUnit_Framework_TestCase '{{ limit }}' => 20, )); - $this->validator->isValid(21, $constraint); + $this->validator->validate(21, $constraint); } } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/TimeValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/TimeValidatorTest.php index 878368bef1..285ab254be 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/TimeValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/TimeValidatorTest.php @@ -37,7 +37,7 @@ class TimeValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(null, new Time()); + $this->validator->validate(null, new Time()); } public function testEmptyStringIsValid() @@ -45,7 +45,7 @@ class TimeValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid('', new Time()); + $this->validator->validate('', new Time()); } public function testDateTimeClassIsValid() @@ -53,7 +53,7 @@ class TimeValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(new \DateTime(), new Time()); + $this->validator->validate(new \DateTime(), new Time()); } /** @@ -61,7 +61,7 @@ class TimeValidatorTest extends \PHPUnit_Framework_TestCase */ public function testExpectsStringCompatibleType() { - $this->validator->isValid(new \stdClass(), new Time()); + $this->validator->validate(new \stdClass(), new Time()); } /** @@ -72,7 +72,7 @@ class TimeValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid($time, new Time()); + $this->validator->validate($time, new Time()); } public function getValidTimes() @@ -99,7 +99,7 @@ class TimeValidatorTest extends \PHPUnit_Framework_TestCase '{{ value }}' => $time, )); - $this->validator->isValid($time, $constraint); + $this->validator->validate($time, $constraint); } public function getInvalidTimes() diff --git a/src/Symfony/Component/Validator/Tests/Constraints/TrueValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/TrueValidatorTest.php index 8c1d7dddcf..25901793a0 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/TrueValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/TrueValidatorTest.php @@ -37,7 +37,7 @@ class TrueValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(null, new True()); + $this->validator->validate(null, new True()); } public function testTrueIsValid() @@ -45,7 +45,7 @@ class TrueValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(true, new True()); + $this->validator->validate(true, new True()); } public function testFalseIsInvalid() @@ -59,6 +59,6 @@ class TrueValidatorTest extends \PHPUnit_Framework_TestCase ->with('myMessage', array( )); - $this->validator->isValid(false, $constraint); + $this->validator->validate(false, $constraint); } } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/TypeValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/TypeValidatorTest.php index 3dd4ed9e11..4b68b25252 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/TypeValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/TypeValidatorTest.php @@ -39,7 +39,7 @@ class TypeValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(null, new Type(array('type' => 'integer'))); + $this->validator->validate(null, new Type(array('type' => 'integer'))); } public function testEmptyIsValidIfString() @@ -47,12 +47,12 @@ class TypeValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid('', new Type(array('type' => 'string'))); + $this->validator->validate('', new Type(array('type' => 'string'))); } public function testEmptyIsInvalidIfNoString() { - $this->validator->isValid('', new Type(array('type' => 'integer'))); + $this->validator->validate('', new Type(array('type' => 'integer'))); } /** @@ -65,7 +65,7 @@ class TypeValidatorTest extends \PHPUnit_Framework_TestCase $constraint = new Type(array('type' => $type)); - $this->validator->isValid($value, $constraint); + $this->validator->validate($value, $constraint); } public function getValidValues() @@ -122,7 +122,7 @@ class TypeValidatorTest extends \PHPUnit_Framework_TestCase '{{ type }}' => $type, )); - $this->validator->isValid($value, $constraint); + $this->validator->validate($value, $constraint); } public function getInvalidValues() diff --git a/src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php index e9b05192cc..bace8069b8 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php @@ -37,7 +37,7 @@ class UrlValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid(null, new Url()); + $this->validator->validate(null, new Url()); } public function testEmptyStringIsValid() @@ -45,7 +45,7 @@ class UrlValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid('', new Url()); + $this->validator->validate('', new Url()); } /** @@ -53,7 +53,7 @@ class UrlValidatorTest extends \PHPUnit_Framework_TestCase */ public function testExpectsStringCompatibleType() { - $this->validator->isValid(new \stdClass(), new Url()); + $this->validator->validate(new \stdClass(), new Url()); } /** @@ -64,7 +64,7 @@ class UrlValidatorTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->never()) ->method('addViolation'); - $this->validator->isValid($url, new Url()); + $this->validator->validate($url, new Url()); } public function getValidUrls() @@ -119,7 +119,7 @@ class UrlValidatorTest extends \PHPUnit_Framework_TestCase '{{ value }}' => $url, )); - $this->validator->isValid($url, $constraint); + $this->validator->validate($url, $constraint); } public function getInvalidUrls() @@ -154,7 +154,7 @@ class UrlValidatorTest extends \PHPUnit_Framework_TestCase 'protocols' => array('ftp', 'file', 'git') )); - $this->validator->isValid($url, $constraint); + $this->validator->validate($url, $constraint); } public function getValidCustomUrls() diff --git a/src/Symfony/Component/Validator/Tests/Fixtures/ConstraintAValidator.php b/src/Symfony/Component/Validator/Tests/Fixtures/ConstraintAValidator.php index 890f447ab6..702a904d51 100644 --- a/src/Symfony/Component/Validator/Tests/Fixtures/ConstraintAValidator.php +++ b/src/Symfony/Component/Validator/Tests/Fixtures/ConstraintAValidator.php @@ -26,7 +26,7 @@ class ConstraintAValidator extends ConstraintValidator self::$passedContext = $context; } - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { if ('VALID' != $value) { $this->context->addViolation('message', array('param' => 'value')); diff --git a/src/Symfony/Component/Validator/Tests/Fixtures/FailingConstraintValidator.php b/src/Symfony/Component/Validator/Tests/Fixtures/FailingConstraintValidator.php index 73d7a61bb3..854e80f35d 100644 --- a/src/Symfony/Component/Validator/Tests/Fixtures/FailingConstraintValidator.php +++ b/src/Symfony/Component/Validator/Tests/Fixtures/FailingConstraintValidator.php @@ -16,7 +16,7 @@ use Symfony\Component\Validator\ConstraintValidator; class FailingConstraintValidator extends ConstraintValidator { - public function isValid($value, Constraint $constraint) + public function validate($value, Constraint $constraint) { $this->context->addViolation($constraint->message, array());