‪TYPO3CMS  ‪main
ContentObjectRendererTestTrait.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 
23 {
24  private function ‪getLibParseFunc_RTE(): array
25  {
26  return [
27  'parseFunc' => '',
28  'parseFunc.' => [
29  'allowTags' => 'a, abbr, acronym, address, article, aside, b, bdo, big, blockquote, br, caption, center, cite, code, col, colgroup, dd, del, dfn, dl, div, dt, em, font, footer, header, h1, h2, h3, h4, h5, h6, hr, i, img, ins, kbd, label, li, link, meta, nav, ol, p, pre, q, samp, sdfield, section, small, span, strike, strong, style, sub, sup, table, thead, tbody, tfoot, td, th, tr, title, tt, u, ul, var',
30  'constants' => '1',
31  'denyTags' => '*',
32  'externalBlocks' => 'article, aside, blockquote, div, dd, dl, footer, header, nav, ol, section, table, ul, pre',
33  'externalBlocks.' => [
34  'article.' => [
35  'callRecursive' => '1',
36  'stripNL' => '1',
37  ],
38  'aside.' => [
39  'callRecursive' => '1',
40  'stripNL' => '1',
41  ],
42  'blockquote.' => [
43  'callRecursive' => '1',
44  'stripNL' => '1',
45  ],
46  'dd.' => [
47  'callRecursive' => '1',
48  'stripNL' => '1',
49  ],
50  'div.' => [
51  'callRecursive' => '1',
52  'stripNL' => '1',
53  ],
54  'dl.' => [
55  'callRecursive' => '1',
56  'stripNL' => '1',
57  ],
58  'footer.' => [
59  'callRecursive' => '1',
60  'stripNL' => '1',
61  ],
62  'header.' => [
63  'callRecursive' => '1',
64  'stripNL' => '1',
65  ],
66  'nav.' => [
67  'callRecursive' => '1',
68  'stripNL' => '1',
69  ],
70  'ol.' => [
71  'callRecursive' => '1',
72  'stripNL' => '1',
73  ],
74  'section.' => [
75  'callRecursive' => '1',
76  'stripNL' => '1',
77  ],
78  'table.' => [
79  'HTMLtableCells' => '1',
80  'HTMLtableCells.' => [
81  'addChr10BetweenParagraphs' => '1',
82  'default.' => [
83  'stdWrap.' => [
84  'parseFunc' => '=< lib.parseFunc_RTE',
85  'parseFunc.' => [
86  'nonTypoTagStdWrap.' => [
87  'encapsLines.' => [
88  'nonWrappedTag' => '',
89  ],
90  ],
91  ],
92  ],
93  ],
94  ],
95  'stdWrap.' => [
96  'HTMLparser' => '1',
97  'HTMLparser.' => [
98  'keepNonMatchedTags' => '1',
99  'tags.' => [
100  'table.' => [
101  'fixAttrib.' => [
102  'class.' => [
103  'always' => '1',
104  'default' => 'contenttable',
105  'list' => 'contenttable',
106  ],
107  ],
108  ],
109  ],
110  ],
111  ],
112  'stripNL' => '1',
113  ],
114  'ul.' => [
115  'callRecursive' => '1',
116  'stripNL' => '1',
117  ],
118  ],
119  'makelinks' => '1',
120  'makelinks.' => [
121  'http.' => [
122  'extTarget.' => [
123  'override' => '_blank',
124  ],
125  'keep' => 'path',
126  ],
127  ],
128  'nonTypoTagStdWrap.' => [
129  'encapsLines.' => [
130  'addAttributes.' => [
131  'P.' => [
132  'class' => 'bodytext',
133  'class.' => [
134  'setOnly' => 'blank',
135  ],
136  ],
137  ],
138  'encapsTagList' => 'p,pre,h1,h2,h3,h4,h5,h6,hr,dt,li',
139  'innerStdWrap_all.' => [
140  'ifBlank' => '&nbsp;',
141  ],
142  'nonWrappedTag' => 'P',
143  'remapTag.' => [
144  'DIV' => 'P',
145  ],
146  ],
147  'HTMLparser' => '1',
148  'HTMLparser.' => [
149  'htmlSpecialChars' => '2',
150  'keepNonMatchedTags' => '1',
151  ],
152  ],
153  'sword' => '<span class="csc-sword">|</span>',
154  'tags.' => [
155  'link' => 'TEXT',
156  'link.' => [
157  'current' => '1',
158  'parseFunc.' => [
159  'constants' => '1',
160  ],
161  'typolink.' => [
162  'directImageLink' => false,
163  'extTarget.' => [
164  'override' => '',
165  ],
166  'parameter.' => [
167  'data' => 'parameters : allParams',
168  ],
169  'target.' => [
170  'override' => '',
171  ],
172  ],
173  ],
174  ],
175  ],
176  ];
177  }
178 
179  private function ‪createSiteWithLanguage(array $languageConfiguration): ‪Site
180  {
181  return new ‪Site('test', 1, [
182  'identifier' => 'test',
183  'rootPageId' => 1,
184  'base' => '/',
185  'languages' => [
186  array_merge(
187  $languageConfiguration,
188  [
189  'base' => '/',
190  ]
191  ),
192  ],
193  ]);
194  }
195 }
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTestTrait
Definition: ContentObjectRendererTestTrait.php:23
‪TYPO3\CMS\Core\Site\Entity\Site
Definition: Site.php:42
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject
Definition: CaseContentObjectTest.php:18
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTestTrait\createSiteWithLanguage
‪createSiteWithLanguage(array $languageConfiguration)
Definition: ContentObjectRendererTestTrait.php:179
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTestTrait\getLibParseFunc_RTE
‪getLibParseFunc_RTE()
Definition: ContentObjectRendererTestTrait.php:24