[TASK] Test for dangling instances in unit test execution
If a test adds some mock or prophecy revelation to the GeneralUtility::makeInstance() stack using addInstance(), it is important the test subject actually consumes that instance. Otherwise, the dangling instance can have side effects on other tests run afterwards. The patch raises typo3/testing-framework from 3.0.0 to 3.1.0 which extends tearDown() with a test to verify the instance stack is empty. If not, the test fails with an accordig message. composer command used: composer update typo3/testing-framework An @internal method to GeneralUtility is added to retrieve the current instance stack, and one test is fixed which violates this rule. Change-Id: I769b82bf704834bf5d1718cbf39b9b411438e30c Resolves: #83948 Releases: master Reviewed-on: https://review.typo3.org/55769 Tested-by:TYPO3com <no-reply@typo3.com> Reviewed-by:
Anja Leichsenring <aleichsenring@ab-softlab.de> Tested-by:
Anja Leichsenring <aleichsenring@ab-softlab.de> Reviewed-by:
Andreas Fernandez <a.fernandez@scripting-base.de> Tested-by:
Andreas Fernandez <a.fernandez@scripting-base.de>
Showing
- composer.lock 5 additions, 5 deletionscomposer.lock
- typo3/sysext/core/Classes/Utility/GeneralUtility.php 16 additions, 0 deletionstypo3/sysext/core/Classes/Utility/GeneralUtility.php
- typo3/sysext/core/Tests/Unit/Authentication/BackendUserAuthenticationTest.php 0 additions, 10 deletions...sts/Unit/Authentication/BackendUserAuthenticationTest.php
Please register or sign in to comment