[BUGFIX] Followup to #54131

added unit tests.

This change adds the mocking to the new tests.

Resolves: #54131
Releases: 6.1, 6.2
Change-Id: I09abbcea6a2c6310b7a04774808aa92ab8ad1c86
Reviewed-on: https://review.typo3.org/27220
Reviewed-by: Wouter Wolters
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind