For functional tests: provide function for forgetting instances
In some situations during functional testing, it is necessary to drop a registered singleton instance before / after running a single test, to make sure that a fresh one is used for the next test.
One example is the TYPO3CR NodeRepository which keeps track of added objects. Instead of implementing a special tearDown() method for that NodeRepository, it would be much cleaner to just drop the instance and thus getting a fresh NodeRepository for the next test.
[FEATURE] Support dropping instances in the Object Manager
This adds a non-API function to the Object Manager which allows for
unregistering instances of arbitrary objects. The next time an object
of that type is requested, a new instance will be created.
This function can be used in functional tests, but must be used with
care because if other parts of the application already use an instance
of the respective type, the whole application might become unstable
because multiple instances of a singleton could be the result.