Skip to content
Snippets Groups Projects
Commit 39a38679 authored by Stefan Bürk's avatar Stefan Bürk
Browse files

[TASK] Ensure correct SiteConfiguration in `SlugServiceTest.php`

It is possible, that the `SiteConfiguration` is retrieved from
the `Dependency Injection container` by code executed before
the test releated site configuration is written, which does not
reset the instance based `SiteConfiguration->$firstLevelCache`
property and later retrieving site configurations using the
`SiteFinder`, for example in rootline and other operations,
cannot find the test instance configurations.

With #103470 this has been mitigated within the `SiteBasedTestTrait`,
but `\TYPO3\CMS\Redirects\Tests\Functional\Service\SlugServiceTest`
uses direct method for additional site configurations suffering from
the very same issue.

This change modifies the `SlugServiceTest` to retrieve the
`SiteConfiguration` from the `Dependency Injection container`
to ensure proper internal cache invalidation for SiteConfig
write operations and additionally ensure cache invalidation
by calling `SiteFinder->getAllSites(false)`.

Resolves: #103471
Related: #103470
Releases: main, 12.4
Change-Id: I27075ad9f5640aaea07df81a97c8b0326fd76003
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83574


Tested-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarGarvin Hicking <gh@faktor-e.de>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarGarvin Hicking <gh@faktor-e.de>
parent 74a7d937
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