8000 [Intl] Date tests broken without intl extension, IntlDateFormatter · Issue #15049 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Intl] Date tests broken without intl extension, IntlDateFormatter #15049

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

Closed
ewgRa opened this issue Jun 20, 2015 · 4 comments
Closed

[Intl] Date tests broken without intl extension, IntlDateFormatter #15049

ewgRa opened this issue Jun 20, 2015 · 4 comments
Labels

Comments

@ewgRa
Copy link
Contributor
ewgRa commented Jun 20, 2015

When intl extension not installed, many tests that use IntlDateFormatter is broken. For example:

1) Symfony\Component\Validator\Tests\Constraints\RangeValidatorTest::testInvalidDatesCombinedMin with data set #0 (DateTime Object (...), 'Mar 20, 2013, 12:00 AM')
Failed asserting that two objects are equal.
--- Expected
+++ Actual
@@ @@
 Symfony\Component\Validator\ConstraintViolation Object (
     'message' => null
     'messageTemplate' => 'myMinMessage'
     'parameters' => Array (
-        '{{ value }}' => 'Mar 20, 2013, 12:00 AM'
-        '{{ limit }}' => 'Mar 10, 2014, 12:00 AM'
+        '{{ value }}' => 'Mar 20, 2013 12:00 AM'
+        '{{ limit }}' => 'Mar 10, 2014 12:00 AM'
     )
     'plural' => null
     'root' => 'root'
     'propertyPath' => 'property.path'
     'invalidValue' => 'InvalidValue'
     'constraint' => Symfony\Component\Validator\Constraints\NotNull Object (...)
     'code' => 3
     'cause' => null
 )

When I install intl extension with ICU 52.1 and change getIcuStubVersion to my ICU version - tests passed without failures.

I write PR #15045 that fix it in my machine, but seems it broke tests that run on travis and I can't find reason why on travis native IntDateFormatter return no comma after year, but later in tests start returning with comma.

@linaori
Copy link
Contributor
linaori commented Jun 21, 2015

This is exactly the error I got running tests locally. There are around 70 failing tests because of this.

@ewgRa
Copy link
Contributor Author
ewgRa commented Jun 21, 2015

@iltar Can you test my PR? Is it testEqualWithNative fail for you when intl extension installed?
Which one ICU version you have?

Many developers haven't intl extension and when they run tests such many broken tests will be confuse them.

@linaori
Copy link
Contributor
linaori commented Jun 21, 2015

@ewgRa Sadly not within the upcoming week as I have a week off work and I cannot access my workstation from home.

@webmozart webmozart added the Intl label Jun 23, 2015
@stof
Copy link
Member
stof commented Jul 30, 2015

This is the reason why we have many tests being skipped when the ICU data of the Intl extension does not match the stub version data, because we write tests for the icu version implemented by the stub. However, it looks like these tests are missing the IntlTestHelper::requireIntl($this) call to ensure we have the ICU data at the version at which tests are written (and they should be written at the version implemented in stubs, which is not the case either).
the fix would be to add the missing check in these tests and update them for the ICU 51 data (you can disable intl and run tests against the stub implementation for that)

fabpot added a commit that referenced this issue Aug 26, 2015
This PR was merged into the 2.3 branch.

Discussion
----------

Add appveyor.yml for C.I. on Windows

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | YES, both on Travis (Linux) and on Appveyor (Windows)!
| Fixed tickets | #13934, #15049, #14259, #15045, #15444
| License       | MIT
| Doc PR        | symfony/symfony-docs#5654

- testing two matrix lines:
  - one without mbtring nor fileinfo nor intl
  - one with these ext enables, intl version 51.2 so that almost no test is skipped on our Intl component
- bug fixes thanks to these harder testing conditions
- some display bug on appveyor, [reported here](http://help.appveyor.com/discussions/suggestions/197-support-ansi-color-codes).

Commits
-------

ea5d656 Windows and Intl fixes
8bbd8d9 Add appveyor.yml for C.I. on Windows
@fabpot fabpot closed this as completed Aug 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants
0