‪TYPO3CMS  10.4
PageLinkHandlerTest.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
19 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
20 
21 class ‪PageLinkHandlerTest extends UnitTestCase
22 {
23 
30  {
31  return [
32  'current page - cool style' => [
33  [
34  'uid' => 'current'
35  ],
36  [
37  'pageuid' => 'current'
38  ],
39  't3://page?uid=current'
40  ],
41  'current empty page - cool style' => [
42  [
43 
44  ],
45  [
46  'pageuid' => 'current'
47  ],
48  't3://page?uid=current'
49  ],
50  'simple page - cool style' => [
51  [
52  'uid' => 13
53  ],
54  [
55  'pageuid' => 13
56  ],
57  't3://page?uid=13'
58  ]
59  ];
60  }
61 
71  public function ‪resolveReturnsSplitParameters($input, $expected, $finalString)
72  {
73  $subject = new ‪PageLinkHandler();
74  // fragment it is processed outside handler data
75  if (isset($expected['fragment'])) {
76  unset($expected['fragment']);
77  }
78  self::assertEquals($expected, $subject->resolveHandlerData($input));
79  }
80 
90  public function ‪splitParametersToUnifiedIdentifier($input, $parameters, $expected)
91  {
92  $subject = new ‪PageLinkHandler();
93  self::assertEquals($expected, $subject->asString($parameters));
94  }
95 }