Skip to content
Snippets Groups Projects
Commit b6528d03 authored by Christian Kuhn's avatar Christian Kuhn Committed by Andreas Fernandez
Browse files

[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: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
parent c9206f8d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment