Skip to content
Snippets Groups Projects
Commit d19937b9 authored by Stefan Bürk's avatar Stefan Bürk Committed by Nikita Hovratov
Browse files

[BUGFIX] Avoid dirty `SilentConfigurationUpgradeServiceTest` test setup

With #100407 the `SilentConfigurationUpgradeServiceTest` has been
promoted from a unit test to a functional test to avoid a mocking
party.

Tests in this test cases write "test configuration" to the test
instances `LocalConfiguration.php` file. For this the update method
`ConfigurationManager->updateLocalConfiguration` is used to set
the test configuration upon the generated test-instance config.

Secondly, the `SilentConfigurationUpgradeService` is used to check
for changed configurations. This service also updates the config,
even if not reloading it. Reload would be done for the next test.

These two facts together leads to dirty LocalConfiguration.php for a
test. Deterministic setup per test is not guaranteed, because the
configuration is not properly cleaned up after a test.

This change stores the functional test instances configuration
in `setUp()` and restores it in `tearDown()`, using the
write method `ConfigurationManager->writeLocalConfiguration()`.
This resets `LocalConfiguration.php` to the state which has
been created by the testing-framework.

The correct expectation, that no change happened, is set for
`versionNumberInFilenameSetToTrueStaysUntouched`.

Resolves: #101075
Related: #100407
Releases: main, 12.4
Change-Id: I18dd80fee04cc27cbb709cfb1c7494dc975edc42
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/79392


Tested-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarNikita Hovratov <nikita.h@live.de>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarNikita Hovratov <nikita.h@live.de>
Tested-by: default avatarcore-ci <typo3@b13.com>
parent 2a68ec55
Branches
Tags
No related merge requests found
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