Review main Merged

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

Stefan Bürk CR +2 V +2 Easy +7 −5 updated 03/23/24, 20:18

Commit message

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)`.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Garvin Hicking +1
    • Benni Mack +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Garvin Hicking +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 2

Files 1

Review log 56

  1. Stefan Bürk uploaded patch set 1 03/22/24, 18:27

  2. core-ci voted on patch set 1 V +1 03/22/24, 18:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54859

  3. Benni Mack voted on patch set 1 CR +1 V +1 03/22/24, 20:16

  4. Garvin Hicking voted on patch set 1 CR +1 V +1 03/23/24, 20:18

  5. Stefan Bürk voted on patch set 1 CR +2 V +2 03/23/24, 20:18

  6. Stefan Bürk merged patch set 2 03/23/24, 20:18