Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing tests for DateValidator with ICU tzdata 2017c #15140

Closed
Vovan-VE opened this issue Nov 10, 2017 · 2 comments
Closed

Failing tests for DateValidator with ICU tzdata 2017c #15140

Vovan-VE opened this issue Nov 10, 2017 · 2 comments
Assignees

Comments

@Vovan-VE
Copy link
Contributor

I'm not sure is it related to Yii itself or not.

What steps will reproduce the problem?

  1. Catch the fact that built-in ICU tzdata became outdated. Same timestamp with specific time zone produce different output between intl and native PHP's TZ handling.
  2. Update ICU tzdata to latest 2017c according to ICU manual linked from Yii guide. Same things are described here (ru).
  3. Run Yii2 tests for validators.

What is the expected result?

Tests passed.

What do you get instead?

There were 3 failures:

1) yiiunit\framework\validators\DateValidatorTest::testIntlValidationWithTime with data set #0 ('UTC')
Failed asserting that false is true.

.../tests/framework/validators/DateValidatorTest.php:318
.../vendor/phpunit/phpunit/phpunit:52

2) yiiunit\framework\validators\DateValidatorTest::testIntlValidationWithTime with data set #1 ('Europe/Berlin')
Failed asserting that false is true.

.../tests/framework/validators/DateValidatorTest.php:318
.../vendor/phpunit/phpunit/phpunit:52

3) yiiunit\framework\validators\DateValidatorTest::testIntlValidationWithTime with data set #2 ('America/Jamaica')
Failed asserting that false is true.

.../tests/framework/validators/DateValidatorTest.php:318
.../vendor/phpunit/phpunit/phpunit:52

FAILURES!

Additional info

Q A
Yii version 2.0.13
PHP version 7.0.22-0ubuntu0.16.04.1
Operating system Ubuntu
libicu55 55.1-7ubuntu0.3
@schmunk42
Copy link
Contributor

Related: #13750

@samdark samdark modified the milestones: 2.0.14, infrastructure Nov 10, 2017
@cebe cebe self-assigned this Nov 13, 2017
@schmunk42
Copy link
Contributor

schmunk42 commented Jan 18, 2018

The data format has slightly changed, I think. I just debugged this on PHP 7.2.

When changing the failing lines to:

$this->assertTrue($val->validate('31/05/2017, 12:30'));
$this->assertTrue($val->validate('31.05.2017, 12:30'));

...tests pass. I found this by using the formatter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants