Feature #30018

For functional tests: provide function for forgetting instances

Added by Robert Lemke over 8 years ago. Updated over 8 years ago.

Should have
Start date:
Due date:
% Done:


PHP Version:
Has patch:


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.

Associated revisions

Revision d22fa5ee (diff)
Added by Robert Lemke over 8 years ago

[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.

Change-Id: I789d346d280e93e765340ab9c9bb71ddc328f24e
Resolves: #30018


#1 Updated by Mr. Hudson over 8 years ago

  • Status changed from Accepted to Under Review

Patch set 1 of change I789d346d280e93e765340ab9c9bb71ddc328f24e has been pushed to the review server.
It is available at http://review.typo3.org/5053

#2 Updated by Robert Lemke over 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF