use Symfony\Component\Validator\Constraints\Date;
use Symfony\Component\Validator\Constraints\DateValidator;
-use Symfony\Component\Validator\Validation;
+use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
-class DateValidatorTest extends AbstractConstraintValidatorTest
+class DateValidatorTest extends ConstraintValidatorTestCase
{
- protected function getApiVersion()
- {
- return Validation::API_VERSION_2_5;
- }
-
protected function createValidator()
{
return new DateValidator();
$this->assertNoViolation();
}
+ public function testDateTimeImmutableClassIsValid()
+ {
+ $this->validator->validate(new \DateTimeImmutable(), new Date());
+
+ $this->assertNoViolation();
+ }
+
/**
* @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException
*/