TYPO3 CMS  TYPO3_7-6
TypolinkViewHelperTest.php
Go to the documentation of this file.
1 <?php
3 
4 /* *
5  * This script is part of the TYPO3 project - inspiring people to share! *
6  * *
7  * TYPO3 is free software; you can redistribute it and/or modify it under *
8  * the terms of the GNU General Public License version 2 as published by *
9  * the Free Software Foundation. *
10  * *
11  * This script is distributed in the hope that it will be useful, but *
12  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
13  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
14  * Public License for more details. *
15  * */
16 
19 
24 {
28  public function typoScriptConfigurationData()
29  {
30  return [
31  'empty input' => [
32  '', // input from link field
33  '', // additional parameters from fluid
34  '', //expected typolink
35  ],
36  'simple id input' => [
37  19,
38  '',
39  '19',
40  ],
41  'external url with target' => [
42  'www.web.de _blank',
43  '',
44  'www.web.de _blank',
45  ],
46  'page with class' => [
47  '42 - css-class',
48  '',
49  '42 - css-class',
50  ],
51  'page with title' => [
52  '42 - - "a link title"',
53  '',
54  '42 - - "a link title"',
55  ],
56  'page with title and parameters' => [
57  '42 - - "a link title" &x=y',
58  '',
59  '42 - - "a link title" &x=y',
60  ],
61  'page with title and extended parameters' => [
62  '42 - - "a link title" &x=y',
63  '&a=b',
64  '42 - - "a link title" &x=y&a=b',
65  ],
66  'only page id and overwrite' => [
67  '42',
68  '&a=b',
69  '42 - - - &a=b',
70  ],
71  ];
72  }
73 
82  public function createTypolinkParameterArrayFromArgumentsReturnsExpectedArray($input, $additionalParametersFromFluid, $expected)
83  {
85  $subject = $this->getAccessibleMock(TypolinkViewHelper::class, ['dummy']);
86  $result = $subject->_call('createTypolinkParameterArrayFromArguments', $input, $additionalParametersFromFluid);
87  $this->assertSame($expected, $result);
88  }
89 }
getAccessibleMock( $originalClassName, $methods=[], array $arguments=[], $mockClassName='', $callOriginalConstructor=true, $callOriginalClone=true, $callAutoload=true)