From d88b8cd90207f3bbc025646c3300b1db1f69b9f8 Mon Sep 17 00:00:00 2001 From: Christian Kuhn Date: Wed, 28 Feb 2024 10:07:25 +0100 Subject: [PATCH] [TASK] Update invalid test data providers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport of https://review.typo3.org/c/Packages/TYPO3.CMS/+/83155 to TYPO3 v12. PHPUnit 10.5.18 introduces deprecation warning due to use of non-matching parameter names with data providers, introduced by https://github.com/sebastianbergmann/phpunit/pull/5812. This patch backports changes that were made for PHPUnit v11 support, which also addresses these kind of deprecation warnings too. Resolves: #103634 Related: #103222 Releases: 12.4 Change-Id: Ia9a1f7c5d62894dc80b3d1f9b465fb488b3250fc Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83788 Tested-by: Anja Leichsenring Reviewed-by: Anja Leichsenring Reviewed-by: Christian Kuhn Tested-by: core-ci Tested-by: Stefan Bürk Reviewed-by: Stefan Bürk Tested-by: Christian Kuhn --- Tests/Functional/Command/CliCommandTest.php | 44 +++++++------- .../DataHandling/Regular/MinValueTest.php | 6 +- Tests/Functional/Imaging/IconFactoryTest.php | 38 ++++++------ .../Resource/Driver/LocalDriverTest.php | 6 +- .../Resource/StorageRepositoryTest.php | 60 +++++++++---------- Tests/Unit/DataHandling/DataHandlerTest.php | 6 +- .../EmailSoftReferenceParserTest.php | 26 ++++---- .../ExtensionPathSoftReferenceParserTest.php | 18 +++--- .../TypoLinkTagSoftReferenceParserTest.php | 32 +++++----- .../UrlSoftReferenceParserTest.php | 40 ++++++------- .../Localization/Parser/XliffParserTest.php | 30 +++++----- Tests/Unit/Migrations/TcaMigrationTest.php | 14 ++--- Tests/Unit/Session/UserSessionManagerTest.php | 6 +- 13 files changed, 163 insertions(+), 163 deletions(-) diff --git a/Tests/Functional/Command/CliCommandTest.php b/Tests/Functional/Command/CliCommandTest.php index 0026862fc3..a9fa642b93 100644 --- a/Tests/Functional/Command/CliCommandTest.php +++ b/Tests/Functional/Command/CliCommandTest.php @@ -50,28 +50,28 @@ public function setUp(): void public static function commandTestDataProvider(): array { return [ - ['command' => 'cleanup:localprocessedfiles', 'args' => ['-v'], 'code' => 0], - ['command' => 'cache:flush', 'args' => [], 'code' => 0], - ['command' => 'cache:warmup', 'args' => [], 'code' => 0], - ['command' => 'cleanup:flexforms', 'args' => [], 'code' => 0], - ['command' => 'cleanup:deletedrecords', 'args' => [], 'code' => 0], - ['command' => 'cleanup:orphanrecords', 'args' => [], 'code' => 0], - ['command' => 'cleanup:previewlinks', 'args' => [], 'code' => 0], - ['command' => 'cleanup:versions', 'args' => [], 'code' => 0], - ['command' => 'extension:list', 'args' => [], 'code' => 0], - ['command' => 'extension:setup', 'args' => [], 'code' => 0], - ['command' => 'extension:deactivate workspaces', 'args' => [], 'code' => 0], - ['command' => 'extension:activate workspaces', 'args' => [], 'code' => 0], - ['command' => 'language:update', 'args' => [], 'code' => 0], - ['command' => 'mailer:spool:send', 'args' => [], 'code' => 1], - ['command' => 'redirects:checkintegrity', 'args' => [], 'code' => 0], - ['command' => 'redirects:cleanup', 'args' => [], 'code' => 0], - ['command' => 'referenceindex:update', 'args' => ['--check'], 'code' => 0], - ['command' => 'scheduler:run', 'args' => [], 'code' => 0], - ['command' => 'site:list', 'args' => [], 'code' => 0], - ['command' => 'site:show show-me', 'args' => [], 'code' => 0], - ['command' => 'syslog:list', 'args' => [], 'code' => 0], - ['command' => 'upgrade:list', 'args' => [], 'code' => 0], + ['command' => 'cleanup:localprocessedfiles', 'args' => ['-v'], 'expectedExitCode' => 0], + ['command' => 'cache:flush', 'args' => [], 'expectedExitCode' => 0], + ['command' => 'cache:warmup', 'args' => [], 'expectedExitCode' => 0], + ['command' => 'cleanup:flexforms', 'args' => [], 'expectedExitCode' => 0], + ['command' => 'cleanup:deletedrecords', 'args' => [], 'expectedExitCode' => 0], + ['command' => 'cleanup:orphanrecords', 'args' => [], 'expectedExitCode' => 0], + ['command' => 'cleanup:previewlinks', 'args' => [], 'expectedExitCode' => 0], + ['command' => 'cleanup:versions', 'args' => [], 'expectedExitCode' => 0], + ['command' => 'extension:list', 'args' => [], 'expectedExitCode' => 0], + ['command' => 'extension:setup', 'args' => [], 'expectedExitCode' => 0], + ['command' => 'extension:deactivate workspaces', 'args' => [], 'expectedExitCode' => 0], + ['command' => 'extension:activate workspaces', 'args' => [], 'expectedExitCode' => 0], + ['command' => 'language:update', 'args' => [], 'expectedExitCode' => 0], + ['command' => 'mailer:spool:send', 'args' => [], 'expectedExitCode' => 1], + ['command' => 'redirects:checkintegrity', 'args' => [], 'expectedExitCode' => 0], + ['command' => 'redirects:cleanup', 'args' => [], 'expectedExitCode' => 0], + ['command' => 'referenceindex:update', 'args' => ['--check'], 'expectedExitCode' => 0], + ['command' => 'scheduler:run', 'args' => [], 'expectedExitCode' => 0], + ['command' => 'site:list', 'args' => [], 'expectedExitCode' => 0], + ['command' => 'site:show show-me', 'args' => [], 'expectedExitCode' => 0], + ['command' => 'syslog:list', 'args' => [], 'expectedExitCode' => 0], + ['command' => 'upgrade:list', 'args' => [], 'expectedExitCode' => 0], ]; } diff --git a/Tests/Functional/DataHandling/Regular/MinValueTest.php b/Tests/Functional/DataHandling/Regular/MinValueTest.php index c63bbe5cb7..fbd409659a 100644 --- a/Tests/Functional/DataHandling/Regular/MinValueTest.php +++ b/Tests/Functional/DataHandling/Regular/MinValueTest.php @@ -68,13 +68,13 @@ public static function valuesLowerThanMinResetToEmptyStringDataProvider(): itera #[DataProvider('valuesLowerThanMinResetToEmptyStringDataProvider')] #[Test] - public function valuesLowerThanMinResetToEmptyString(string $string, string $expected): void + public function valuesLowerThanMinResetToEmptyString(string $value, string $expected): void { // Should work for type=input and type=text (except RTE). $actionService = new ActionService(); $map = $actionService->createNewRecord('tt_content', 1, [ - 'tx_testdatahandler_input_minvalue' => $string, - 'tx_testdatahandler_text_minvalue' => $string, + 'tx_testdatahandler_input_minvalue' => $value, + 'tx_testdatahandler_text_minvalue' => $value, ]); $newRecordId = reset($map['tt_content']); $newRecord = BackendUtility::getRecord('tt_content', $newRecordId); diff --git a/Tests/Functional/Imaging/IconFactoryTest.php b/Tests/Functional/Imaging/IconFactoryTest.php index d2633c8177..ad2b7ee4d2 100644 --- a/Tests/Functional/Imaging/IconFactoryTest.php +++ b/Tests/Functional/Imaging/IconFactoryTest.php @@ -30,15 +30,15 @@ final class IconFactoryTest extends FunctionalTestCase { - protected IconFactory $subject; - protected string $notRegisteredIconIdentifier = 'my-super-unregistered-identifier'; - protected string $registeredIconIdentifier = 'actions-close'; - protected string $registeredSpinningIconIdentifier = 'spinning-icon'; + private IconFactory $subject; + private string $notRegisteredIconIdentifier = 'my-super-unregistered-identifier'; + private string $registeredIconIdentifier = 'actions-close'; + private string $registeredSpinningIconIdentifier = 'spinning-icon'; /** * Simulate a tt_content record */ - protected array $mockRecord = [ + private array $mockRecord = [ 'header' => 'dummy content header', 'uid' => '1', 'pid' => '1', @@ -68,10 +68,10 @@ protected function setUp(): void public static function differentSizesDataProvider(): array { return [ - ['size ' . Icon::SIZE_DEFAULT => ['input' => Icon::SIZE_DEFAULT, 'expected' => Icon::SIZE_DEFAULT]], - ['size ' . Icon::SIZE_SMALL => ['input' => Icon::SIZE_SMALL, 'expected' => Icon::SIZE_SMALL]], - ['size ' . Icon::SIZE_MEDIUM => ['input' => Icon::SIZE_MEDIUM, 'expected' => Icon::SIZE_MEDIUM]], - ['size ' . Icon::SIZE_LARGE => ['input' => Icon::SIZE_LARGE, 'expected' => Icon::SIZE_LARGE]], + 'size ' . Icon::SIZE_DEFAULT => ['size' => Icon::SIZE_DEFAULT, 'expected' => Icon::SIZE_DEFAULT], + 'size ' . Icon::SIZE_SMALL => ['size' => Icon::SIZE_SMALL, 'expected' => Icon::SIZE_SMALL], + 'size ' . Icon::SIZE_MEDIUM => ['size' => Icon::SIZE_MEDIUM, 'expected' => Icon::SIZE_MEDIUM], + 'size ' . Icon::SIZE_LARGE => ['size' => Icon::SIZE_LARGE, 'expected' => Icon::SIZE_LARGE], ]; } @@ -95,21 +95,21 @@ public function getIconByIdentifierReturnsIconWithCorrectMarkupIfRegisteredIconI #[DataProvider('differentSizesDataProvider')] #[Test] - public function getIconByIdentifierAndSizeReturnsIconWithCorrectMarkupIfRegisteredIconIdentifierIsUsed($size): void + public function getIconByIdentifierAndSizeReturnsIconWithCorrectMarkupIfRegisteredIconIdentifierIsUsed(string $size, string $expected): void { self::assertStringContainsString( - '