Problem
The JobQueueGroup class can only be created through the JobQueueGroup::singleton() factory method. Services which need to enqueue jobs therefore rely on MediaWiki global state in their service wiring – a dependency that can’t be mocked away.
Proposed Solution
Create a new service that will replace JobQueueGroup::singleton(), e.g. named JobQueueGroupFactory. By making it part of the service container, the JobQueueGroup::destroySingletons() method should also become unnecessary (the singletons would be destroyed with all other services).