From d041062093b625ee163f2ad0c56edc7c6604b686 Mon Sep 17 00:00:00 2001 From: Christian Kuhn <lolli@schwarzbu.ch> Date: Mon, 20 Dec 2021 17:02:10 +0100 Subject: [PATCH] [TASK] Remove unused method in FormViewHelper Resolves: #96403 Releases: main Change-Id: Id4843f31254fe2b4bd46fe3c7c37669c6f3a06f0 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72744 Tested-by: Benni Mack <benni@typo3.org> Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de> Tested-by: core-ci <typo3@b13.com> Tested-by: Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by: Benni Mack <benni@typo3.org> Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de> Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch> --- .../Classes/ViewHelpers/FormViewHelper.php | 22 ------ .../Unit/ViewHelpers/FormViewHelperTest.php | 76 ------------------- 2 files changed, 98 deletions(-) delete mode 100644 typo3/sysext/fluid/Tests/Unit/ViewHelpers/FormViewHelperTest.php diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/FormViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/FormViewHelper.php index 8e0c53de9432..730f4e633cea 100644 --- a/typo3/sysext/fluid/Classes/ViewHelpers/FormViewHelper.php +++ b/typo3/sysext/fluid/Classes/ViewHelpers/FormViewHelper.php @@ -395,28 +395,6 @@ class FormViewHelper extends AbstractFormViewHelper } } - /** - * Add the URI arguments after postprocessing to the request hash as well. - * @param array $arguments - * @param array $results - * @param string $currentPrefix - * @param int $level - */ - protected function postProcessUriArgumentsForRequestHash($arguments, &$results, $currentPrefix = '', $level = 0) - { - if (count($arguments)) { - foreach ($arguments as $argumentName => $argumentValue) { - $argumentName = (string)$argumentName; - if (is_array($argumentValue)) { - $prefix = $level == 0 ? $argumentName : $currentPrefix . '[' . $argumentName . ']'; - $this->postProcessUriArgumentsForRequestHash($argumentValue, $results, $prefix, $level + 1); - } else { - $results[] = $level == 0 ? $argumentName : $currentPrefix . '[' . $argumentName . ']'; - } - } - } - } - /** * Retrieves the default field name prefix for this form * diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/FormViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/FormViewHelperTest.php deleted file mode 100644 index c95f4de7fae2..000000000000 --- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/FormViewHelperTest.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers; - -use TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper; -use TYPO3\TestingFramework\Core\Unit\UnitTestCase; - -class FormViewHelperTest extends UnitTestCase -{ - /** - * Data Provider for postProcessUriArgumentsForRequestHashWorks - */ - public function argumentsForPostProcessUriArgumentsForRequestHash(): array - { - return [ - // simple values - [ - [ - 'bla' => 'X', - 'blubb' => 'Y', - ], - [ - 'bla', - 'blubb', - ], - ], - // Arrays - [ - [ - 'bla' => [ - 'test1' => 'X', - 'test2' => 'Y', - ], - 'blubb' => 'Y', - ], - [ - 'bla[test1]', - 'bla[test2]', - 'blubb', - ], - ], - ]; - } - - /** - * @test - * @dataProvider argumentsForPostProcessUriArgumentsForRequestHash - * @param $arguments - * @param $expectedResults - */ - public function postProcessUriArgumentsForRequestHashWorks($arguments, $expectedResults): void - { - $formViewHelper = new FormViewHelper(); - $results = []; - $mock = \Closure::bind(static function (FormViewHelper $formViewHelper) use ($arguments, &$results) { - return $formViewHelper->postProcessUriArgumentsForRequestHash($arguments, $results); - }, null, FormViewHelper::class); - $mock($formViewHelper); - self::assertEquals($expectedResults, $results); - } -} -- GitLab