zendframework / zend-i18n

I18n component from Zend Framework
BSD 3-Clause "New" or "Revised" License
65 stars 49 forks source link

Ensure `translator_plugins` config is honored in non-zend-mvc contexts #74

Closed weierophinney closed 7 years ago

weierophinney commented 7 years ago

Per https://discourse.zendframework.com/t/validatormanager-not-calling-custom-validator-factory/109/5?u=matthew the translator_plugins config key is not honored currently unless the application is within a zend-mvc context. This is due to the fact that Zend\I18n\Module wires configuration for the Zend\ModuleManager\Listener\ServiceListener in order to push merged service configuration into the plugin during bootstrap; no similar logic is available when not in a zend-mvc context, however.

This patch fixes that situation by modifying the LoaderPluginManagerFactory to do the following:

weierophinney commented 7 years ago

Test failures are all on lowest, due to zend-servicemanager test expectation updates to use PHPUnit 5.7/6.0 expectException syntax within the LoaderPluginManagerCompatibilityTest, which is unrelated. When run manually against an earlier zend-servicemanager version, the new tests pass.