[TASK] Avoid protected & private data providers
phpunit test data providers had to be public ever since [1]. phpunit calls them using reflection. With PHP 8.1, setAccessible() does not need to be called anymore, methods are always considered accessible via Reflection [2], so they can be technically set to protected or private with phpunit ^9. phpunit ^10 however actively deprecates non-public (and non-static) data providers. In main, a couple of test data providers were set to protected or private during v12 development, using the PHP 8.1 'always accessible' feature. The patch declares affected data providers public, and adds the static keyword along the way. This also makes phpstan a bit more happy. [1] https://docs.phpunit.de/en/9.6/writing-tests-for-phpunit.html#data-providers [2] https://www.php.net/manual/en/migration81.other-changes.php#migration81.other-changes.functions.reflection Resolves: #100248 Related: #100249 Releases: main Change-Id: I1f646bc90a95ba993618a81e03ecd38d2a179f7a Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/78209 Reviewed-by:Torben Hansen <derhansen@gmail.com> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch> Tested-by:
Torben Hansen <derhansen@gmail.com> Reviewed-by:
Benni Mack <benni@typo3.org> Tested-by:
Benni Mack <benni@typo3.org>
Showing
- Build/phpstan/phpstan-baseline.neon 0 additions, 60 deletionsBuild/phpstan/phpstan-baseline.neon
- typo3/sysext/core/Tests/Unit/DataHandling/DataHandlerTest.php 1 addition, 1 deletion...3/sysext/core/Tests/Unit/DataHandling/DataHandlerTest.php
- typo3/sysext/core/Tests/Unit/Migrations/TcaMigrationTest.php 11 additions, 11 deletionstypo3/sysext/core/Tests/Unit/Migrations/TcaMigrationTest.php
- typo3/sysext/core/Tests/Unit/Site/Entity/SiteLanguageTest.php 1 addition, 1 deletion...3/sysext/core/Tests/Unit/Site/Entity/SiteLanguageTest.php
- typo3/sysext/core/Tests/UnitDeprecated/Configuration/FlexForm/FlexFormToolsTest.php 1 addition, 1 deletion...itDeprecated/Configuration/FlexForm/FlexFormToolsTest.php
Please register or sign in to comment