[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/27216
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring