Improve component manager separation in Base Test Case
Currently all tests get a complete copy (including subobjects) of the component manager injected. This happens in source:Packages/Testing/Classes/T3_Testing_BaseTestCase.php#398 . However, the serialize / unserialize method will surely cause problems as soon as we have persistence in place, so we need a finer grained solution here.
The problem is that some unit tests do change component configuration or even package configuration. This needs to be isolated from other tests.
- FLOW3: Added new folders and files to the global /Configuration directory
- FLOW3: Added new sections to the documentation (FLOW3 Bootstrap and Cache).
- FLOW3: Implemented a finer grained, improved bootstrap within the FLOW3 class. The boot sequence now consists of different initialization levels which assert that initialization on higher levels can only be done if lower levels have been initialized and once initialized, a level can't be initialized again.
- FLOW3: Added new (yet quite empty) sections to the manual.
- FLOW3: (Package) Moved the component configuration functions to the FLOW3 class.
- FLOW3: (Error) The exception handler now shows the beginning and the ending of an argument value (instead of only the beginning) if it is longer than 40 characters.
- FLOW3: (AOP) Had to remove the getAspectContainers() method again because it conflicted with caching. If we really need this function, it can be reimplemented, but it will only work if proxy caching is disabled.
- FLOW3: (Utility) Made sure that paths returned by getPathToTemporaryDirectory() end with a slash as defined in DIRECTORY_SEPARATOR
- TYPO3CR: Made the StorageAccess_PDOTest use a temporary directory instead of the private file cache
- Testing: Improved the cloning of the component manager by switching from unserialize(serialize()) to "clone". Addresses #81 (but maybe doesn't complete solve it).
#4 Updated by Malte Jansen almost 12 years ago
Perhaps some variables could be unset in some classes, which are not needed anymore after there usage (especially if the classObject is stored tempoarly).
Until now this solved the problem for the TYPO3CGL, which works in simluar ways to the Testing-Package with PHPUnit. The TYPO3CGL still works with less than 32MB of memory. Before unsetting some variables it was more than 64MB.
#6 Updated by Karsten Dambekalns almost 11 years ago
This one will be solved by simply not providing any part of FLOW3 to the BaseTestCase and making sure all tests use mocked versions of the needed components. I started refactoring tests towards that goal late last year and we'll continue to do so, at least for FLOW3, TYPO3CR and other core parts.
To make sure your tests run in the future, make sure to never use the provided $this->objectManager in your testcases.