You are here

public function DateTimeValidatorTest::getInvalidDateTimes in Plug 7

File

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