symfony/symfony — pull request #9206 by bschussek (2013-10-03 15:26:38+00:00)
Title: [Intl] Improved consistency of resource bundle output

| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | yes
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | TODO

This PR contains new, excessive integration tests for the Intl component that check whether the methods of the resource bundles work correctly and consistently in practice. When I wrote this test suite, I discovered numerous bugs that have been fixed in this PR.

I had to do **two BC breaks:**

1) I changed the `Intl::get*Bundle()->get*()` methods to throw exceptions instead of just returning `null` on errors. Otherwise it would have been impossible to fix the existing bugs. Consequently, anybody using these methods *directly* with invalid languages, locales etc. will now experience an uncaught exception. People using the Form layer only should not be affected.

2) I changed the default value of `$fallback` the protected `AbstractBundle::readEntry()` method from `false` to `true`. The method is just a proxy to `StructuredBundleReader::readEntry()`, which also has the default `true` for this parameter. This BC break obviously only affects people who extended `AbstractBundle` (I'd be surprised if anyone did).

The new test suite (see the `*ConsistencyTest`) is a very nice documentation of the current state of the ICU data, so go and check it out. Some tests are very slow, so I created a new group `icu-consistency` for them.

TODO:

- [x] Test and upgrade symfony/Icu 1.2.x
- [ ] Test and upgrade symfony/Icu 1.1.x
- [ ] Test and upgrade symfony/Icu 1.0.x
- [ ] Make sure no BC breaks leak through to the Form component