-
Notifications
You must be signed in to change notification settings - Fork 667
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Mitigate PHPUnit
NameAlreadyInUseException
PHPUnit changed the way how double creation is handled internally and now emits an exception if a manually defined `mock class name` should be registered. In some places within the unit tests, manual mock class names have been used, because the names are needed for cross referencing at a later point. For this, different approaches have been used, for example hardcoded MD5 hashes as strings or creating hashes of static values like `md5('1')`, and also reused hashes in different places or in tests using data providers. This now leads to an exception: PHPUnit\Framework\MockObject\Generator\NameAlreadyInUseException The name "b70551b2b2db62b6b15a9bbfcbd50614" is already in use This change mitigates the issue by using `StringUtility::getUniqueId('somePrefix')` as is already done in other places. As a sideeffect, four phpstan baseline entries can be removed. Used command(s): Build/Scripts/runTests.sh -s phpstanGenerateBaseline [1] sebastianbergmann/phpunit#5804 Resolves: #104005 Releases: main, 12.4 Change-Id: Icc558844275c9ae9f67a0e7c20daa318f5ad6b41 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/84530 Reviewed-by: Christian Kuhn <[email protected]> Tested-by: core-ci <[email protected]> Tested-by: Christian Kuhn <[email protected]> Tested-by: Andreas Wolf <[email protected]> Reviewed-by: Andreas Wolf <[email protected]>
- Loading branch information
Showing
3 changed files
with
16 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters