[TASK] Test for dangling instances in unit test execution 69/55769/4
authorChristian Kuhn <lolli@schwarzbu.ch>
Fri, 16 Feb 2018 22:11:35 +0000 (23:11 +0100)
committerAndreas Fernandez <a.fernandez@scripting-base.de>
Sat, 17 Feb 2018 15:37:49 +0000 (16:37 +0100)
commitb6528d03ab6212ac196da0432569093384b16ead
treea1c40ca0f9aefa41b056515c301fa302218d4d1b
parentc9206f8d28bcedf873c3b99573f21da64c783fbe
[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>
composer.lock
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/core/Tests/Unit/Authentication/BackendUserAuthenticationTest.php