You are here

public function DateTimeValidatorTest::testInvalidDateTimes in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Tests/Constraints/DateTimeValidatorTest.php \Symfony\Component\Validator\Tests\Constraints\DateTimeValidatorTest::testInvalidDateTimes()

@dataProvider getInvalidDateTimes

File

vendor/symfony/validator/Tests/Constraints/DateTimeValidatorTest.php, line 81

Class

DateTimeValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testInvalidDateTimes($dateTime, $code) {
  $constraint = new DateTime(array(
    'message' => 'myMessage',
  ));
  $this->validator
    ->validate($dateTime, $constraint);
  $this
    ->buildViolation('myMessage')
    ->setParameter('{{ value }}', '"' . $dateTime . '"')
    ->setCode($code)
    ->assertRaised();
}