Feature #30018
For functional tests: provide function for forgetting instances
Status: | Resolved | Start date: | 2011-09-19 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | Robert Lemke | % Done: | 100% |
|
Category: | Object | |||
Target version: | TYPO3 Flow Base Distribution - 1.0.0 | |||
PHP Version: | Complexity: | |||
Has patch: |
Description
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
[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
History
#1 Updated by Mr. Hudson almost 4 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 almost 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset d22fa5ee33802ccafc7b64ce278e40a2286d55bb.