‪TYPO3CMS  11.5
FormViewHelperTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
21 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
22 
23 class ‪FormViewHelperTest extends UnitTestCase
24 {
29  {
30  return [
31  // simple values
32  [
33  [
34  'bla' => 'X',
35  'blubb' => 'Y',
36  ],
37  [
38  'bla',
39  'blubb',
40  ],
41  ],
42  // Arrays
43  [
44  [
45  'bla' => [
46  'test1' => 'X',
47  'test2' => 'Y',
48  ],
49  'blubb' => 'Y',
50  ],
51  [
52  'bla[test1]',
53  'bla[test2]',
54  'blubb',
55  ],
56  ],
57  ];
58  }
59 
66  public function ‪postProcessUriArgumentsForRequestHashWorks($arguments, $expectedResults): void
67  {
68  $formViewHelper = new ‪FormViewHelper();
69  $results = [];
70  $mock = \Closure::bind(static function (‪FormViewHelper $formViewHelper) use ($arguments, &$results) {
71  return $formViewHelper->‪postProcessUriArgumentsForRequestHash($arguments, $results);
72  }, null, FormViewHelper::class);
73  $mock($formViewHelper);
74  self::assertEquals($expectedResults, $results);
75  }
76 }
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\FormViewHelperTest\argumentsForPostProcessUriArgumentsForRequestHash
‪argumentsForPostProcessUriArgumentsForRequestHash()
Definition: FormViewHelperTest.php:28
‪TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper
Definition: FormViewHelper.php:60
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\FormViewHelperTest\postProcessUriArgumentsForRequestHashWorks
‪postProcessUriArgumentsForRequestHashWorks($arguments, $expectedResults)
Definition: FormViewHelperTest.php:66
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\FormViewHelperTest
Definition: FormViewHelperTest.php:24
‪TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper\postProcessUriArgumentsForRequestHash
‪postProcessUriArgumentsForRequestHash($arguments, &$results, $currentPrefix='', $level=0)
Definition: FormViewHelper.php:404
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers
Definition: FormViewHelperTest.php:18