How to replace EventManager of Controller with mock in Test?

So far it looks to me that the event manager is created on the fly and a call to getControllerFullClass() to retrieve the class object would be too late as by this time the event has already be fired.

Okay, I think I just didn’t think far enough. After I set up all the mocks in configureServiceManager I can just retrieve my controller and set the event Manager with my mock of it. As the controller is also a shared service by default, it will be cached and during ->run() the same instance will be used.