zendframework / zend-validator

Validator component from Zend Framework
BSD 3-Clause "New" or "Revised" License
181 stars 136 forks source link

Maybe bug in testMoscowWinterTime #257

Closed icetee closed 5 years ago

icetee commented 5 years ago

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'));