You are here

public function DateTimeValidatorTest::testInvalidDateTimes in Plug 7

@dataProvider getInvalidDateTimes

File

lib/Symfony/validator/Symfony/Component/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();
}