You are here

public function RangeValidatorTest::getSoonerThanTenthMarch2014 in Plug 7

File

lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php, line 208

Class

RangeValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function getSoonerThanTenthMarch2014() {

  // The provider runs before setUp(), so we need to manually fix
  // the default timezone
  $this
    ->setDefaultTimezone('UTC');
  $tests = array(
    array(
      new \DateTime('March 20, 2013'),
      'Mar 20, 2013, 12:00 AM',
    ),
    array(
      new \DateTime('March 9, 2014'),
      'Mar 9, 2014, 12:00 AM',
    ),
  );
  if (version_compare(PHP_VERSION, '5.5.0-dev', '>=')) {
    $tests[] = array(
      new \DateTimeImmutable('March 20, 2013'),
      'Mar 20, 2013, 12:00 AM',
    );
    $tests[] = array(
      new \DateTimeImmutable('March 9, 2014'),
      'Mar 9, 2014, 12:00 AM',
    );
  }
  $this
    ->restoreDefaultTimezone();
  return $tests;
}