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