PHPUnit tests fail as attachEventListeners() tries to detach the EventManager from services that haven't been loaded

My PHPUnit tests fail as I don't think the Zend\Mvc\View\Http\RouteNotFoundStrategy and Zend\Mvc\View\Http\ExceptionStrategy strategies are loaded when the framework is executed from the console. 

I have update Module.php to check that they are loaded before trying to detach the EventManager.