You are here

public function DateTimeValidatorTest::getInvalidDateTimes 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::getInvalidDateTimes()

File

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

Class

DateTimeValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function getInvalidDateTimes() {
  return array(
    array(
      'foobar',
      DateTime::INVALID_FORMAT_ERROR,
    ),
    array(
      '2010-01-01',
      DateTime::INVALID_FORMAT_ERROR,
    ),
    array(
      '00:00:00',
      DateTime::INVALID_FORMAT_ERROR,
    ),
    array(
      '2010-01-01 00:00',
      DateTime::INVALID_FORMAT_ERROR,
    ),
    array(
      '2010-13-01 00:00:00',
      DateTime::INVALID_DATE_ERROR,
    ),
    array(
      '2010-04-32 00:00:00',
      DateTime::INVALID_DATE_ERROR,
    ),
    array(
      '2010-02-29 00:00:00',
      DateTime::INVALID_DATE_ERROR,
    ),
    array(
      '2010-01-01 24:00:00',
      DateTime::INVALID_TIME_ERROR,
    ),
    array(
      '2010-01-01 00:60:00',
      DateTime::INVALID_TIME_ERROR,
    ),
    array(
      '2010-01-01 00:00:60',
      DateTime::INVALID_TIME_ERROR,
    ),
  );
}