The ControllerManager was injecting an EventManager instance, even if one was available. This meant that if you attached an EM instance inside a factory, it would be overwritten -- losing any listeners attached to it.
This PR does the following:
This is completely BC, as previously, a new EM instance was always injected by the ControllerManager; there was no opportunity to opt-out if your controller was EventManagerAware.
This patch was tested by me and fixed #3650 successfully.
[#3650] Do not re-inject EM instance
- If the controller already composes an EM instance, do not re-inject
it. This allows factories to inject an EM instance and attach
[#3650] Fix failing test
- Override getEventManager() in test asset so that we can test
injection, as parent was lazy initializing an EM instance.