zendframework/zend-validator

Maybe bug in testMoscowWinterTime

Closed this issue · 0 comments

I send another topic pull request and failed the testMoscowWinterTime. The test did not run before midnight, it runs smoothly after midnight. (Can be triggered by clock setting.)

1) ZendTest\Validator\DateStepTest::testMoscowWinterTime with data set #2 ('27-03-2011')
Failed asserting that false is true.

/home/travis/build/zendframework/zend-validator/test/DateStepTest.php:151

I don't know the code so much, but UTC was always good on the local machine.

$date = DateTime::createFromFormat($this->format, $value, $this->timezone);

change to

$date = DateTime::createFromFormat($this->format, $value, new DateTimeZone('UTC'));