2 declare(strict_types = 1);
19 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
33 'enableRichtext' =>
true,
37 'aClass' =>
'aConfig',
40 'removeComments' =>
'1',
48 'overruleMode' =>
'myTransformation',
58 'aClass' =>
'aConfig',
60 'removeComments' =>
'1',
62 'overruleMode' =>
'myTransformation',
65 'aClass' =>
'aConfig',
68 'overruleMode' =>
'myTransformation',
73 $subject = $this->getAccessibleMock(Richtext::class, [
'getRtePageTsConfigOfPid'], [],
'',
false);
74 $subject->expects($this->once())->method(
'getRtePageTsConfigOfPid')->with(42)->willReturn($pageTsConfig);
75 $output = $subject->getConfiguration(
'aTable',
'aField', 42,
'textmedia', $fieldConfig);
76 $this->assertSame($expected,
$output);
86 'enableRichtext' =>
true,
90 'aClass' =>
'aConfig',
93 'removeComments' =>
'1',
99 'overruleMode' =>
'myTransformation',
107 'aClass' =>
'aConfig',
109 'removeComments' =>
'1',
111 'overruleMode' =>
'myTransformation',
114 'aClass' =>
'aConfig',
117 'overruleMode' =>
'myTransformation',
122 $subject = $this->getAccessibleMock(Richtext::class, [
'getRtePageTsConfigOfPid'], [],
'',
false);
123 $subject->expects($this->once())->method(
'getRtePageTsConfigOfPid')->with(42)->willReturn($pageTsConfig);
124 $output = $subject->getConfiguration(
'aTable',
'aField', 42,
'textmedia', $fieldConfig);
125 $this->assertSame($expected,
$output);
135 'enableRichtext' =>
true,
139 'aClass' =>
'aConfig',
142 'removeComments' =>
'1',
147 'aClass' =>
'aConfig',
149 'removeComments' =>
'1',
151 'aClass' =>
'aConfig',
154 'overruleMode' =>
'default',
159 $subject = $this->getAccessibleMock(Richtext::class, [
'getRtePageTsConfigOfPid'], [],
'',
false);
160 $subject->expects($this->once())->method(
'getRtePageTsConfigOfPid')->with(42)->willReturn($pageTsConfig);
161 $output = $subject->getConfiguration(
'aTable',
'aField', 42,
'textmedia', $fieldConfig);
162 $this->assertSame($expected,
$output);
172 'enableRichtext' =>
true,
176 'aClass' =>
'aConfig',
180 'aClass' =>
'anotherConfig',
184 'contentsCss' =>
'my.css'
191 'aClass' =>
'anotherConfig',
195 'contentsCss' =>
'my.css'
199 'aClass' =>
'anotherConfig',
203 'contentsCss' =>
'my.css'
207 'overruleMode' =>
'default',
212 $subject = $this->getAccessibleMock(Richtext::class, [
'getRtePageTsConfigOfPid'], [],
'',
false);
213 $subject->expects($this->once())->method(
'getRtePageTsConfigOfPid')->with(42)->willReturn($pageTsConfig);
214 $output = $subject->getConfiguration(
'aTable',
'aField', 42,
'textmedia', $fieldConfig);
215 $this->assertSame($expected,
$output);
225 'enableRichtext' =>
true,
229 'aClass' =>
'aConfig',
233 'aClass' =>
'anotherConfig',
240 'aClass' =>
'aThirdConfig',
244 'contentsCss' =>
'my.css'
254 'aClass' =>
'aThirdConfig',
258 'contentsCss' =>
'my.css'
263 'aClass' =>
'aThirdConfig',
267 'contentsCss' =>
'my.css'
271 'overruleMode' =>
'default',
276 $subject = $this->getAccessibleMock(Richtext::class, [
'getRtePageTsConfigOfPid'], [],
'',
false);
277 $subject->expects($this->once())->method(
'getRtePageTsConfigOfPid')->with(42)->willReturn($pageTsConfig);
278 $output = $subject->getConfiguration(
'aTable',
'aField', 42,
'textmedia', $fieldConfig);
279 $this->assertSame($expected,
$output);
289 'enableRichtext' =>
true,
293 'aClass' =>
'aConfig',
297 'aClass' =>
'anotherConfig',
304 'aClass' =>
'aThirdConfig',
308 'contentsCss' =>
'my.css'
314 'aClass' =>
'aTypeSpecifcConfig',
318 'contentsCss' =>
'your.css'
330 'aClass' =>
'aTypeSpecifcConfig',
334 'contentsCss' =>
'your.css'
339 'aClass' =>
'aTypeSpecifcConfig',
343 'contentsCss' =>
'your.css'
347 'overruleMode' =>
'default',
352 $subject = $this->getAccessibleMock(Richtext::class, [
'getRtePageTsConfigOfPid'], [],
'',
false);
353 $subject->expects($this->once())->method(
'getRtePageTsConfigOfPid')->with(42)->willReturn($pageTsConfig);
354 $output = $subject->getConfiguration(
'aTable',
'aField', 42,
'textmedia', $fieldConfig);
355 $this->assertSame($expected,
$output);
364 $presetKey =
'default';
374 $pageTsConfigArray = [
375 'preset' => $presetKey,
383 $subject = $this->getAccessibleMock(
385 [
'loadConfigurationFromPreset',
'getRtePageTsConfigOfPid'],
390 $subject->expects($this->once())->method(
'loadConfigurationFromPreset')->with($presetKey)->willReturn($preset);
391 $subject->expects($this->once())->method(
'getRtePageTsConfigOfPid')->with($pageId)->willReturn($pageTsConfigArray);
393 $output = $subject->getConfiguration(
'tt_content',
'bodytext', $pageId,
'textmedia', $pageTsConfigArray);
401 'preset' =>
'default',
408 'overruleMode' =>
'default',
412 $this->assertSame($expected,
$output);