‪TYPO3CMS  11.5
FluidTemplateContentObjectTest.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 
20 use PHPUnit\Framework\MockObject\MockObject;
21 use Prophecy\Argument;
22 use Prophecy\Doubler\Generator\Node\ReturnTypeNode;
23 use Prophecy\PhpUnit\ProphecyTrait;
24 use Prophecy\Prophecy\ObjectProphecy;
25 use Psr\Container\ContainerInterface;
27 use TYPO3\CMS\Core\Page\PageRenderer;
34 use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
37 use TYPO3\TestingFramework\Core\AccessibleObjectInterface;
38 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
39 use TYPO3Fluid\Fluid\View\AbstractTemplateView;
40 
47 class ‪FluidTemplateContentObjectTest extends UnitTestCase
48 {
49  use ProphecyTrait;
50 
54  protected ‪$resetSingletonInstances = true;
55 
59  protected MockObject ‪$subject;
60 
62  protected ObjectProphecy ‪$contentObjectRendererProphecy;
63 
64  protected ContentObjectRenderer ‪$contentObjectRenderer;
65 
70 
74  protected MockObject ‪$standaloneView;
75 
79  protected MockObject ‪$request;
80 
84  protected function ‪setUp(): void
85  {
86  parent::setUp();
87  $this->contentDataProcessor = new ‪ContentDataProcessor($this->prophesize(ContainerInterface::class)->reveal());
88  $this->contentObjectRendererProphecy = $this->prophesize(ContentObjectRenderer::class);
89  $this->contentObjectRenderer = $this->contentObjectRendererProphecy->reveal();
90  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
91  $this->subject = $this->getAccessibleMock(
92  FluidTemplateContentObject::class,
93  ['initializeStandaloneViewInstance'],
94  [$this->contentObjectRenderer]
95  );
96  $tsfe = $this->createMock(TypoScriptFrontendController::class);
97  $tsfe->tmpl = $this->getMockBuilder(TemplateService::class)
98  ->disableOriginalConstructor()
99  ->getMock();
100  ‪$GLOBALS['TSFE'] = $tsfe;
101  }
102 
106  protected function ‪addMockViewToSubject(): void
107  {
108  $this->standaloneView = $this->createMock(StandaloneView::class);
109  $this->request = $this->getMockBuilder(Request::class)->getMock();
110  $this->standaloneView->method('getRequest')->willReturn($this->request);
111  $this->standaloneView->method('renderSection')->willReturn('');
112  $this->subject->_set('view', $this->standaloneView);
113  }
114 
118  public function ‪constructSetsContentObjectRenderer(): void
119  {
120  ‪$contentObjectRenderer = new ContentObjectRenderer();
121  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
122  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer);
123  self::assertEquals(‪$contentObjectRenderer, ‪$subject->getContentObjectRenderer());
124  }
125 
129  public function ‪renderCallsInitializeStandaloneViewInstance(): void
130  {
131  $this->‪addMockViewToSubject();
132  $this->subject->expects(self::once())->method('initializeStandaloneViewInstance');
133  $this->subject->render([]);
134  }
135 
140  {
141  $configuration = [
142  'templateName' => 'foobar',
143  'templateRootPaths.' => [
144  10 => 'dummyPath',
145  '10.' => [
146  'wrap' => '|5/',
147  ],
148  15 => 'dummyPath6/',
149  '25.' => [
150  'field' => 'someField',
151  ],
152  ],
153  ];
154  ‪$contentObjectRenderer = $this->prophesize(ContentObjectRenderer::class);
155 
156  $standAloneView = $this->prophesize(StandaloneView::class);
157  $standAloneView->setTemplateRootPaths(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
158  $standAloneView->setTemplate(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
159  $standAloneView->assignMultiple(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
160  $standAloneView->render(Argument::cetera())->willReturn('');
161  $standAloneView->renderSection(Argument::cetera())->willReturn('');
162  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
163  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
164  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer->reveal());
165 
166  ‪$subject->render($configuration);
167 
168  ‪$contentObjectRenderer->stdWrap('dummyPath', ['wrap' => '|5/'])->shouldHaveBeenCalled();
169  ‪$contentObjectRenderer->stdWrap('', ['field' => 'someField'])->shouldHaveBeenCalled();
170  }
171 
175  public function ‪renderSetsTemplateFileInView(): void
176  {
177  $configuration = ['file' => 'EXT:core/bar.html'];
178 
179  ‪$contentObjectRenderer = $this->prophesize(ContentObjectRenderer::class);
180  ‪$contentObjectRenderer->stdWrapValue(Argument::cetera())->shouldBeCalledTimes(8);
181  ‪$contentObjectRenderer->stdWrapValue('file', $configuration)->willReturn('EXT:core/bar.html');
182  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
183  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer->reveal());
184 
185  $standAloneView = $this->prophesize(StandaloneView::class);
186  $standAloneView->assignMultiple(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
187  $standAloneView->render(Argument::cetera())->willReturn('');
188  $standAloneView->renderSection(Argument::cetera())->willReturn('');
189  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
190 
191  ‪$subject->render($configuration);
192 
193  $standAloneView->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:core/bar.html'))->shouldHaveBeenCalled();
194  }
195 
199  public function ‪renderSetsTemplateFileByTemplateInView(): void
200  {
201  $configuration = [
202  'template' => 'FILE',
203  'template.' => [
204  'file' => ‪Environment::getPublicPath() . '/foo/bar.html',
205  ],
206  ];
207 
208  ‪$contentObjectRenderer = $this->prophesize(ContentObjectRenderer::class);
209  ‪$contentObjectRenderer->stdWrapValue(Argument::cetera())->shouldBeCalledTimes(7);
210  ‪$contentObjectRenderer->cObjGetSingle('FILE', ['file' => ‪Environment::getPublicPath() . '/foo/bar.html'], 'template')->willReturn('baz');
211 
212  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
213  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer->reveal());
214  $standAloneView = $this->prophesize(StandaloneView::class);
215  $standAloneView->assignMultiple(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
216  $standAloneView->render(Argument::cetera())->willReturn('');
217  $standAloneView->renderSection(Argument::cetera())->willReturn('');
218  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
219 
220  ‪$subject->render($configuration);
221 
222  $standAloneView->setTemplateSource('baz')->shouldHaveBeenCalled();
223  }
224 
228  public function ‪renderSetsTemplateFileByTemplateNameInView(): void
229  {
230  $configuration = [
231  'templateName' => 'foo',
232  'templateRootPaths.' => [
233  0 => 'dummyPath1/',
234  1 => 'dummyPath2/',
235  ],
236  ];
237  ‪$contentObjectRenderer = $this->prophesize(ContentObjectRenderer::class);
238  ‪$contentObjectRenderer->stdWrapValue(Argument::cetera())->shouldBeCalledTimes(8);
239  ‪$contentObjectRenderer->stdWrapValue('templateName', $configuration)->willReturn('foo');
240 
241  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
242  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer->reveal());
243 
244  $standAloneView = $this->prophesize(StandaloneView::class);
245  $standAloneView->setTemplateRootPaths(Argument::cetera())->shouldBeCalled();
246  $standAloneView->assignMultiple(Argument::cetera())->shouldBeCalled();
247  $standAloneView->renderSection(Argument::cetera())->willReturn('');
248  $standAloneView->render()->willReturn('');
249  $standAloneView->getFormat()->willReturn('html');
250  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
251 
252  ‪$subject->render($configuration);
253 
254  $standAloneView->setTemplate('foo')->shouldHaveBeenCalled();
255  }
256 
261  {
262  $configuration = [
263  'templateName' => 'TEXT',
264  'templateName.' => ['value' => 'bar'],
265  'templateRootPaths.' => [
266  0 => 'dummyPath1/',
267  1 => 'dummyPath2/',
268  ],
269  ];
270 
271  ‪$contentObjectRenderer = $this->prophesize(ContentObjectRenderer::class);
272  ‪$contentObjectRenderer->stdWrapValue(Argument::cetera())->shouldBeCalledTimes(8);
273  ‪$contentObjectRenderer->stdWrapValue('templateName', $configuration)->willReturn('bar');
274 
275  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
276  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer->reveal());
277 
278  $standAloneView = $this->prophesize(StandaloneView::class);
279  $standAloneView->setTemplateRootPaths(Argument::cetera())->shouldBeCalled();
280  $standAloneView->assignMultiple(Argument::cetera())->shouldBeCalled();
281  $standAloneView->renderSection(Argument::cetera())->willReturn('');
282  $standAloneView->render()->willReturn('');
283  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
284 
285  ‪$subject->render($configuration);
286 
287  $standAloneView->setTemplate('bar')->shouldHaveBeenCalled();
288  }
289 
293  public function ‪renderSetsLayoutRootPathInView(): void
294  {
295  $configuration = ['layoutRootPath' => 'foo/bar.html'];
296 
297  ‪$contentObjectRenderer = $this->prophesize(ContentObjectRenderer::class);
298  ‪$contentObjectRenderer->stdWrapValue(Argument::cetera())->shouldBeCalledTimes(8);
299  ‪$contentObjectRenderer->stdWrapValue('layoutRootPath', $configuration)->willReturn('foo/bar.html');
300 
301  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
302  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer->reveal());
303  $standAloneView = $this->prophesize(StandaloneView::class);
304  $standAloneView->setTemplatePathAndFilename(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
305  $standAloneView->assignMultiple(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
306  $standAloneView->render(Argument::cetera())->willReturn('');
307  $standAloneView->renderSection(Argument::cetera())->willReturn('');
308  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
309 
310  ‪$subject->render($configuration);
311 
312  $standAloneView->setLayoutRootPaths([‪Environment::getPublicPath() . '/foo/bar.html'])->shouldHaveBeenCalled();
313  }
314 
319  {
320  $configuration = [
321  'layoutRootPath' => 'foo',
322  'layoutRootPath.' => [
323  'bar' => 'baz',
324  ],
325  ];
326 
327  ‪$contentObjectRenderer = $this->prophesize(ContentObjectRenderer::class);
328  ‪$contentObjectRenderer->stdWrapValue(Argument::cetera())->shouldBeCalledTimes(8);
329 
330  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
331  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer->reveal());
332  $standAloneView = $this->prophesize(StandaloneView::class);
333  $standAloneView->setTemplatePathAndFilename(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
334  $standAloneView->assignMultiple(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
335  $standAloneView->render(Argument::cetera())->willReturn('');
336  $standAloneView->renderSection(Argument::cetera())->willReturn('');
337  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
338 
339  ‪$subject->render($configuration);
340 
341  ‪$contentObjectRenderer->stdWrapValue('layoutRootPath', $configuration)->shouldHaveBeenCalled();
342  }
343 
347  public function ‪layoutRootPathsHasStdWrapSupport(): void
348  {
349  $configuration = [
350  'layoutRootPaths.' => [
351  10 => 'FILE',
352  '10.' => [
353  'file' => 'foo/bar.html',
354  ],
355  20 => 'foo/bar2.html',
356  ],
357  ];
358 
359  ‪$contentObjectRenderer = $this->prophesize(ContentObjectRenderer::class);
360  ‪$contentObjectRenderer->stdWrapValue(Argument::cetera())->shouldBeCalledTimes(8);
361  ‪$contentObjectRenderer->stdWrap('FILE', ['file' => 'foo/bar.html'])->shouldBeCalled();
362 
363  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
364  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer->reveal());
365  $standAloneView = $this->prophesize(StandaloneView::class);
366  $standAloneView->setLayoutRootPaths(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
367  $standAloneView->setTemplatePathAndFilename(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
368  $standAloneView->assignMultiple(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
369  $standAloneView->render(Argument::cetera())->willReturn('');
370  $standAloneView->renderSection(Argument::cetera())->willReturn('');
371  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
372 
373  ‪$subject->render($configuration);
374 
375  ‪$contentObjectRenderer->stdWrap('FILE', ['file' => 'foo/bar.html'])->shouldHaveBeenCalled();
376  }
377 
381  public function ‪fallbacksForLayoutRootPathAreSet(): void
382  {
383  $this->‪addMockViewToSubject();
384  $this->standaloneView
385  ->expects(self::once())
386  ->method('setLayoutRootPaths')
387  ->with([
388  10 => ‪Environment::getPublicPath() . '/foo/bar.html',
389  20 => ‪Environment::getPublicPath() . '/foo/bar2.html',
390  ]);
391  $this->subject->render(['layoutRootPaths.' => [10 => 'foo/bar.html', 20 => 'foo/bar2.html']]);
392  }
393 
398  {
399  $configuration = [
400  'layoutRootPath' => 'foo/main.html',
401  'layoutRootPaths.' => [10 => 'foo/bar.html', 20 => 'foo/bar2.html'],
402  ];
403 
404  ‪$contentObjectRenderer = $this->prophesize(ContentObjectRenderer::class);
405  ‪$contentObjectRenderer->stdWrapValue(Argument::cetera())->shouldBeCalledTimes(8);
406  ‪$contentObjectRenderer->stdWrapValue('layoutRootPath', $configuration)->willReturn('foo/main.html');
407 
408  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
409  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer->reveal());
410  $standAloneView = $this->prophesize(StandaloneView::class);
411  $standAloneView->setTemplatePathAndFilename(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
412  $standAloneView->assignMultiple(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
413  $standAloneView->render(Argument::cetera())->willReturn('');
414  $standAloneView->renderSection(Argument::cetera())->willReturn('');
415  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
416 
417  ‪$subject->render($configuration);
418 
419  $standAloneView->setLayoutRootPaths([
420  0 => ‪Environment::getPublicPath() . '/foo/main.html',
421  10 => ‪Environment::getPublicPath() . '/foo/bar.html',
422  20 => ‪Environment::getPublicPath() . '/foo/bar2.html',
423  ])->shouldHaveBeenCalled();
424  }
425 
429  public function ‪renderSetsPartialRootPathInView(): void
430  {
431  $configuration = ['partialRootPath' => 'foo/bar.html'];
432 
433  ‪$contentObjectRenderer = $this->prophesize(ContentObjectRenderer::class);
434  ‪$contentObjectRenderer->stdWrapValue(Argument::cetera())->shouldBeCalledTimes(8);
435  ‪$contentObjectRenderer->stdWrapValue('partialRootPath', $configuration)->willReturn('foo/bar.html');
436 
437  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
438  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer->reveal());
439  $standAloneView = $this->prophesize(StandaloneView::class);
440  $standAloneView->setTemplatePathAndFilename(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
441  $standAloneView->assignMultiple(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
442  $standAloneView->render(Argument::cetera())->willReturn('');
443  $standAloneView->renderSection(Argument::cetera())->willReturn('');
444  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
445 
446  ‪$subject->render($configuration);
447 
448  $standAloneView->setPartialRootPaths([‪Environment::getPublicPath() . '/foo/bar.html'])->shouldHaveBeenCalled();
449  }
450 
454  public function ‪partialRootPathsHasStdWrapSupport(): void
455  {
456  $configuration = [
457  'partialRootPaths.' => [
458  10 => 'FILE',
459  '10.' => [
460  'file' => 'foo/bar.html',
461  ],
462  20 => 'foo/bar2.html',
463  ],
464  ];
465 
466  ‪$contentObjectRenderer = $this->prophesize(ContentObjectRenderer::class);
467 
468  $standAloneView = $this->prophesize(StandaloneView::class);
469  $standAloneView->setPartialRootPaths(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
470  $standAloneView->setTemplatePathAndFilename(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
471  $standAloneView->assignMultiple(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
472  $standAloneView->render(Argument::cetera())->willReturn('');
473  $standAloneView->renderSection(Argument::cetera())->willReturn('');
474  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
475  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
476  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer->reveal());
477 
478  ‪$subject->render($configuration);
479 
480  ‪$contentObjectRenderer->stdWrap('FILE', ['file' => 'foo/bar.html'])->shouldHaveBeenCalled();
481  }
482 
487  {
488  $configuration = [
489  'partialRootPath' => 'foo',
490  'partialRootPath.' => ['bar' => 'baz'],
491  ];
492 
493  ‪$contentObjectRenderer = $this->prophesize(ContentObjectRenderer::class);
494  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
495  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer->reveal());
496 
497  $standAloneView = $this->prophesize(StandaloneView::class);
498  $standAloneView->setPartialRootPaths(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
499  $standAloneView->setTemplatePathAndFilename(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
500  $standAloneView->assignMultiple(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
501  $standAloneView->render(Argument::cetera())->willReturn('');
502  $standAloneView->renderSection(Argument::cetera())->willReturn('');
503  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
504 
505  ‪$subject->render($configuration);
506 
507  ‪$contentObjectRenderer->stdWrapValue('partialRootPath', $configuration)->shouldHaveBeenCalled();
508  }
509 
513  public function ‪fallbacksForPartialRootPathAreSet(): void
514  {
515  $this->‪addMockViewToSubject();
516  $this->standaloneView
517  ->expects(self::once())
518  ->method('setPartialRootPaths')
519  ->with([10 => ‪Environment::getPublicPath() . '/foo', 20 => ‪Environment::getPublicPath() . '/bar']);
520  $this->subject->render(['partialRootPaths.' => [10 => 'foo', 20 => 'bar']]);
521  }
522 
527  {
528  $configuration = [
529  'partialRootPath' => 'main',
530  'partialRootPaths.' => [10 => 'foo', 20 => 'bar'],
531  ];
532 
533  ‪$contentObjectRenderer = $this->prophesize(ContentObjectRenderer::class);
534  ‪$contentObjectRenderer->stdWrapValue(Argument::cetera())->shouldBeCalledTimes(8);
535  ‪$contentObjectRenderer->stdWrapValue('partialRootPath', $configuration)->willReturn(‪Environment::getPublicPath() . '/main');
536 
537  $standAloneView = $this->prophesize(StandaloneView::class);
538  $standAloneView->setTemplatePathAndFilename(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
539  $standAloneView->assignMultiple(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
540  $standAloneView->render(Argument::cetera())->willReturn('');
541  $standAloneView->renderSection(Argument::cetera())->willReturn('');
542  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
543  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
544  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer->reveal());
545 
546  ‪$subject->render($configuration);
547 
548  $standAloneView->setPartialRootPaths([
549  0 => ‪Environment::getPublicPath() . '/main',
550  10 => ‪Environment::getPublicPath() . '/foo',
551  20 => ‪Environment::getPublicPath() . '/bar',
552  ])
553  ->willReturn(new ReturnTypeNode('void'))
554  ->shouldHaveBeenCalled();
555  }
556 
560  public function ‪renderSetsFormatInView(): void
561  {
562  $configuration = [
563  'format' => 'xml',
564  ];
565 
566  ‪$contentObjectRenderer = $this->prophesize(ContentObjectRenderer::class);
567  ‪$contentObjectRenderer->stdWrapValue(Argument::cetera())->shouldBeCalledTimes(8);
568  ‪$contentObjectRenderer->stdWrapValue('format', $configuration)->willReturn('xml');
569 
570  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
571  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer->reveal());
572  $standAloneView = $this->prophesize(StandaloneView::class);
573  $standAloneView->setTemplatePathAndFilename(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
574  $standAloneView->assignMultiple(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
575  $standAloneView->render(Argument::cetera())->willReturn('');
576  $standAloneView->renderSection(Argument::cetera())->willReturn('');
577  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
578 
579  ‪$subject->render($configuration);
580 
581  $standAloneView->setFormat('xml')->shouldHaveBeenCalled();
582  }
583 
587  public function ‪renderCallsStandardWrapValueForFormat(): void
588  {
589  $configuration = [
590  'format' => 'foo',
591  'format.' => ['bar' => 'baz'],
592  ];
593 
594  ‪$contentObjectRenderer = $this->prophesize(ContentObjectRenderer::class);
595 
596  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
597  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer->reveal());
598  $standAloneView = $this->prophesize(StandaloneView::class);
599  $standAloneView->setTemplatePathAndFilename(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
600  $standAloneView->assignMultiple(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
601  $standAloneView->render(Argument::cetera())->willReturn('');
602  $standAloneView->renderSection(Argument::cetera())->willReturn('');
603  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
604 
605  ‪$subject->render($configuration);
606 
607  ‪$contentObjectRenderer->stdWrapValue('format', $configuration)->shouldHaveBeenCalled();
608  }
609 
613  public function ‪renderSetsExtbasePluginNameInRequest(): void
614  {
615  $configuration = [
616  'extbase.' => [
617  'pluginName' => 'foo',
618  ],
619  ];
620 
621  ‪$contentObjectRenderer = $this->prophesize(ContentObjectRenderer::class);
622  ‪$contentObjectRenderer->stdWrapValue(Argument::cetera())->shouldBeCalledTimes(8);
623  ‪$contentObjectRenderer->stdWrapValue('pluginName', ['pluginName' => 'foo'])->willReturn('foo');
624 
625  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
626  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer->reveal());
627 
628  $standAloneView = $this->prophesize(StandaloneView::class);
629  $standAloneView->setTemplatePathAndFilename('')->shouldBeCalled();
630  $standAloneView->assignMultiple(['data' => [], 'current' => null])->shouldBeCalled();
631  $standAloneView->renderSection(Argument::cetera())->willReturn('');
632  $standAloneView->render(Argument::cetera())->shouldBeCalled();
633 
634  ‪$request = $this->prophesize(Request::class);
635  $standAloneView->getRequest()->willReturn(‪$request->reveal());
636  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
637 
638  ‪$subject->render($configuration);
639 
640  ‪$request->setPluginName('foo')->shouldHaveBeenCalled();
641  }
642 
647  {
648  $configuration = [
649  'pluginName' => 'foo',
650  'pluginName.' => [
651  'bar' => 'baz',
652  ],
653  ];
654 
655  ‪$contentObjectRenderer = $this->prophesize(ContentObjectRenderer::class);
656 
657  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
658  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer->reveal());
659  $standAloneView = $this->prophesize(StandaloneView::class);
660  $standAloneView->setTemplatePathAndFilename(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
661  $standAloneView->assignMultiple(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
662  $standAloneView->render(Argument::cetera())->willReturn('');
663  $standAloneView->renderSection(Argument::cetera())->willReturn('');
664  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
665 
666  ‪$subject->render(['extbase.' => $configuration]);
667 
668  ‪$contentObjectRenderer->stdWrapValue('pluginName', $configuration)->shouldHaveBeenCalled();
669  }
670 
675  {
676  $configuration = [
677  'extbase.' => [
678  'controllerExtensionName' => 'foo',
679  ],
680  ];
681 
682  ‪$contentObjectRenderer = $this->prophesize(ContentObjectRenderer::class);
683  ‪$contentObjectRenderer->stdWrapValue(Argument::cetera())->shouldBeCalledTimes(8);
684  ‪$contentObjectRenderer->stdWrapValue('controllerExtensionName', ['controllerExtensionName' => 'foo'])->willReturn('foo');
685 
686  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
687  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer->reveal());
688 
689  $standAloneView = $this->prophesize(StandaloneView::class);
690  $standAloneView->setTemplatePathAndFilename('')->shouldBeCalled();
691  $standAloneView->assignMultiple(['data' => [], 'current' => null])->shouldBeCalled();
692  $standAloneView->renderSection(Argument::cetera())->willReturn('');
693  $standAloneView->render(Argument::cetera())->shouldBeCalled();
694 
695  ‪$request = $this->prophesize(Request::class);
696  $standAloneView->getRequest()->willReturn(‪$request->reveal());
697  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
698 
699  ‪$subject->render($configuration);
700 
701  ‪$request->setControllerExtensionName('foo')->shouldHaveBeenCalled();
702  }
703 
708  {
709  $configuration = [
710  'controllerExtensionName' => 'foo',
711  'controllerExtensionName.' => [
712  'bar' => 'baz',
713  ],
714  ];
715 
716  ‪$contentObjectRenderer = $this->prophesize(ContentObjectRenderer::class);
717 
718  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
719  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer->reveal());
720 
721  $standAloneView = $this->prophesize(StandaloneView::class);
722  $standAloneView->setTemplatePathAndFilename(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
723  $standAloneView->assignMultiple(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
724  $standAloneView->render(Argument::cetera())->willReturn('');
725  $standAloneView->renderSection(Argument::cetera())->willReturn('');
726  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
727  ‪$subject->render(['extbase.' => $configuration]);
728 
729  ‪$contentObjectRenderer->stdWrapValue('controllerExtensionName', $configuration)->shouldHaveBeenCalled();
730  }
731 
735  public function ‪renderSetsExtbaseControllerNameInRequest(): void
736  {
737  $configuration = [
738  'extbase.' => [
739  'controllerName' => 'foo',
740  ],
741  ];
742 
743  ‪$contentObjectRenderer = $this->prophesize(ContentObjectRenderer::class);
744  ‪$contentObjectRenderer->stdWrapValue(Argument::cetera())->shouldBeCalledTimes(8);
745  ‪$contentObjectRenderer->stdWrapValue('controllerName', ['controllerName' => 'foo'])->willReturn('foo');
746 
747  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
748  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer->reveal());
749 
750  $standAloneView = $this->prophesize(StandaloneView::class);
751  $standAloneView->setTemplatePathAndFilename('')->shouldBeCalled();
752  $standAloneView->assignMultiple(['data' => [], 'current' => null])->shouldBeCalled();
753  $standAloneView->renderSection(Argument::cetera())->willReturn('');
754  $standAloneView->render(Argument::cetera())->shouldBeCalled();
755 
756  ‪$request = $this->prophesize(Request::class);
757  $standAloneView->getRequest()->willReturn(‪$request->reveal());
758  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
759 
760  ‪$subject->render($configuration);
761 
762  ‪$request->setControllerName('foo')->shouldHaveBeenCalled();
763  }
764 
769  {
770  $configuration = [
771  'controllerName' => 'foo',
772  'controllerName.' => [
773  'bar' => 'baz',
774  ],
775  ];
776 
777  ‪$contentObjectRenderer = $this->prophesize(ContentObjectRenderer::class);
778 
779  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
780  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer->reveal());
781  $standAloneView = $this->prophesize(StandaloneView::class);
782  $standAloneView->setTemplatePathAndFilename(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
783  $standAloneView->assignMultiple(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
784  $standAloneView->render(Argument::cetera())->willReturn('');
785  $standAloneView->renderSection(Argument::cetera())->willReturn('');
786  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
787 
788  ‪$subject->render(['extbase.' => $configuration]);
789 
790  ‪$contentObjectRenderer->stdWrapValue('controllerName', $configuration)->shouldHaveBeenCalled();
791  }
792 
797  {
798  $configuration = [
799  'extbase.' => [
800  'controllerActionName' => 'foo',
801  ],
802  ];
803 
804  ‪$contentObjectRenderer = $this->prophesize(ContentObjectRenderer::class);
805  ‪$contentObjectRenderer->stdWrapValue(Argument::cetera())->shouldBeCalledTimes(8);
806  ‪$contentObjectRenderer->stdWrapValue('controllerActionName', ['controllerActionName' => 'foo'])->willReturn('foo');
807 
808  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
809  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer->reveal());
810  $standAloneView = $this->prophesize(StandaloneView::class);
811  $standAloneView->setTemplatePathAndFilename('')->shouldBeCalled();
812  $standAloneView->assignMultiple(['data' => [], 'current' => null])->shouldBeCalled();
813  $standAloneView->renderSection(Argument::cetera())->willReturn('');
814  $standAloneView->render(Argument::cetera())->shouldBeCalled();
815 
816  ‪$request = $this->prophesize(Request::class);
817  $standAloneView->getRequest()->willReturn(‪$request->reveal());
818  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
819 
820  ‪$subject->render($configuration);
821 
822  ‪$request->setControllerActionName('foo')->shouldHaveBeenCalled();
823  }
824 
829  {
830  $configuration = [
831  'controllerActionName' => 'foo',
832  'controllerActionName.' => [
833  'bar' => 'baz',
834  ],
835  ];
836 
837  ‪$contentObjectRenderer = $this->prophesize(ContentObjectRenderer::class);
838 
839  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
840  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer->reveal());
841  $standAloneView = $this->prophesize(StandaloneView::class);
842  $standAloneView->setTemplatePathAndFilename(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
843  $standAloneView->assignMultiple(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
844  $standAloneView->render(Argument::cetera())->willReturn('');
845  $standAloneView->renderSection(Argument::cetera())->willReturn('');
846  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
847 
848  ‪$subject->render(['extbase.' => $configuration]);
849 
850  ‪$contentObjectRenderer->stdWrapValue('controllerActionName', $configuration)->shouldHaveBeenCalled();
851  }
852 
856  public function ‪renderAssignsSettingsArrayToView(): void
857  {
858  $configuration = [
859  'settings.' => [
860  'foo' => 'value',
861  'bar.' => [
862  'baz' => 'value2',
863  ],
864  ],
865  ];
866 
867  $expectedSettingsToBeSet = [
868  'foo' => 'value',
869  'bar' => [
870  'baz' => 'value2',
871  ],
872  ];
873 
874  $typoScriptServiceMock = $this->getMockBuilder(TypoScriptService::class)->getMock();
875  $typoScriptServiceMock
876  ->expects(self::once())
877  ->method('convertTypoScriptArrayToPlainArray')
878  ->with($configuration['settings.'])
879  ->willReturn($expectedSettingsToBeSet);
880  GeneralUtility::addInstance(TypoScriptService::class, $typoScriptServiceMock);
881 
882  $standAloneView = $this->prophesize(StandaloneView::class);
883  $standAloneView->setTemplatePathAndFilename(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
884  $standAloneView->assignMultiple(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
885  $standAloneView->render(Argument::cetera())->willReturn('');
886  $standAloneView->renderSection(Argument::cetera())->willReturn('');
887  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
888  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
889  ‪$subject = new FluidTemplateContentObject($this->prophesize(ContentObjectRenderer::class)->reveal());
890 
891  ‪$subject->render($configuration);
892 
893  $standAloneView->assign('settings', $expectedSettingsToBeSet)->shouldHaveBeenCalled();
894  }
895 
900  {
901  $this->‪addMockViewToSubject();
902  $configuration = [
903  'variables.' => [
904  'data' => 'foo',
905  'data.' => [
906  'bar' => 'baz',
907  ],
908  ],
909  ];
910  $this->expectException(\InvalidArgumentException::class);
911  $this->expectExceptionCode(1288095720);
912  $this->subject->render($configuration);
913  }
914 
919  {
920  $this->‪addMockViewToSubject();
921  $configuration = [
922  'variables.' => [
923  'current' => 'foo',
924  'current.' => [
925  'bar' => 'baz',
926  ],
927  ],
928  ];
929  $this->expectException(\InvalidArgumentException::class);
930  $this->expectExceptionCode(1288095720);
931  $this->subject->render($configuration);
932  }
933 
937  public function ‪renderCallsCObjGetSingleForAllowedVariable(): void
938  {
939  $configuration = [
940  'variables.' => [
941  'aVar' => 'TEXT',
942  'aVar.' => [
943  'value' => 'foo',
944  ],
945  ],
946  ];
947 
948  ‪$contentObjectRenderer = $this->prophesize(ContentObjectRenderer::class);
949 
950  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
951  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer->reveal());
952  $standAloneView = $this->prophesize(StandaloneView::class);
953  $standAloneView->setTemplatePathAndFilename(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
954  $standAloneView->assignMultiple(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
955  $standAloneView->render(Argument::cetera())->willReturn('');
956  $standAloneView->renderSection(Argument::cetera())->willReturn('');
957  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
958 
959  ‪$subject->render($configuration);
960 
961  ‪$contentObjectRenderer->cObjGetSingle('TEXT', ['value' => 'foo'], Argument::any())->shouldHaveBeenCalled();
962  }
963 
968  {
969  $configuration = [
970  'variables.' => [
971  'aVar' => 'TEXT',
972  'aVar.' => [
973  'value' => 'foo',
974  ],
975  ],
976  ];
977 
978  ‪$contentObjectRenderer = $this->prophesize(ContentObjectRenderer::class);
979  ‪$contentObjectRenderer->stdWrapValue(Argument::cetera())->shouldBeCalledTimes(8);
980  ‪$contentObjectRenderer->cObjGetSingle(Argument::cetera())->willReturn('foo');
981 
982  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
983  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer->reveal());
984 
985  $standAloneView = $this->prophesize(StandaloneView::class);
986  $standAloneView->setTemplatePathAndFilename(Argument::cetera())->willReturn(new ReturnTypeNode('void'));
987  $standAloneView->render(Argument::cetera())->willReturn('');
988  $standAloneView->renderSection(Argument::cetera())->willReturn('');
989  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
990 
991  ‪$subject->render($configuration);
992 
993  $standAloneView->assignMultiple(['aVar' => 'foo', 'data' => [], 'current' => null])
994  ->willReturn(new ReturnTypeNode('void'))
995  ->shouldHaveBeenCalled();
996  }
997 
1001  public function ‪renderAssignsContentObjectRendererDataToView(): void
1002  {
1003  $this->‪addMockViewToSubject();
1004  $this->contentObjectRenderer->data = ['foo'];
1005  $this->standaloneView
1006  ->expects(self::once())
1007  ->method('assignMultiple')
1008  ->with(['data' => ['foo'], 'current' => null]);
1009  $this->subject->render([]);
1010  }
1011 
1016  {
1017  $this->‪addMockViewToSubject();
1018  $this->contentObjectRenderer->data = ['currentKey' => 'currentValue'];
1019  $this->contentObjectRenderer->currentValKey = 'currentKey';
1020  $this->standaloneView
1021  ->expects(self::once())
1022  ->method('assignMultiple')
1023  ->with(['data' => ['currentKey' => 'currentValue'], 'current' => 'currentValue']);
1024  $this->subject->render([]);
1025  }
1026 
1030  public function ‪renderCallsRenderOnStandaloneView(): void
1031  {
1032  $this->‪addMockViewToSubject();
1033  $this->standaloneView
1034  ->expects(self::once())
1035  ->method('render');
1036  $this->subject->render([]);
1037  }
1038 
1043  {
1044  $configuration = [
1045  'stdWrap.' => [
1046  'foo' => 'bar',
1047  ],
1048  ];
1049 
1050  ‪$contentObjectRenderer = $this->prophesize(ContentObjectRenderer::class);
1051 
1052  GeneralUtility::addInstance(ContentDataProcessor::class, $this->contentDataProcessor);
1053  ‪$subject = new FluidTemplateContentObject(‪$contentObjectRenderer->reveal());
1054 
1055  $standAloneView = $this->prophesize(StandaloneView::class);
1056  $standAloneView->setTemplatePathAndFilename('')->shouldBeCalled();
1057  $standAloneView->assignMultiple(['data' => [], 'current' => null])->shouldbeCalled();
1058  $standAloneView->renderSection(Argument::cetera())->willReturn('');
1059  $standAloneView->render()->willReturn('baz');
1060  GeneralUtility::addInstance(StandaloneView::class, $standAloneView->reveal());
1061 
1062  ‪$subject->render($configuration);
1063 
1064  ‪$contentObjectRenderer->stdWrap('baz', ['foo' => 'bar'])->shouldHaveBeenCalled();
1065  }
1066 
1075  AbstractTemplateView $viewMock,
1076  ?string $expectedHeader,
1077  ?string $expectedFooter
1078  ): void {
1079  $pageRendererMock = $this->getMockBuilder(PageRenderer::class)->onlyMethods([
1080  'addHeaderData',
1081  'addFooterData',
1082  ])->getMock();
1083  if ($expectedHeader !== null && !empty(trim($expectedHeader))) {
1084  $pageRendererMock->expects(self::once())->method('addHeaderData')->with($expectedHeader);
1085  } else {
1086  $pageRendererMock->expects(self::never())->method('addHeaderData');
1087  }
1088  if ($expectedFooter !== null && !empty(trim($expectedFooter))) {
1089  $pageRendererMock->expects(self::once())->method('addFooterData')->with($expectedFooter);
1090  } else {
1091  $pageRendererMock->expects(self::never())->method('addFooterData');
1092  }
1093 
1094  ‪$subject = $this->getMockBuilder(FluidTemplateContentObject::class)->onlyMethods(['getPageRenderer'])->disableOriginalConstructor()->getMock();
1095  ‪$subject->expects(self::once())->method('getPageRenderer')->willReturn($pageRendererMock);
1096  $viewProperty = new \ReflectionProperty(‪$subject, 'view');
1097  $viewProperty->setAccessible(true);
1098  $viewProperty->setValue(‪$subject, $viewMock);
1099 
1100  $method = new \ReflectionMethod(‪$subject, 'renderFluidTemplateAssetsIntoPageRenderer');
1101  $method->setAccessible(true);
1102  $method->invoke(‪$subject);
1103  }
1104 
1108  public function ‪headerAssetDataProvider(): array
1109  {
1110  $viewWithHeaderData = $this->getMockBuilder(AbstractTemplateView::class)->onlyMethods(['renderSection'])->disableOriginalConstructor()->getMock();
1111  $viewWithHeaderData->expects(self::exactly(2))->method('renderSection')
1112  ->withConsecutive(
1113  [
1114  'HeaderAssets',
1115  self::anything(),
1116  true,
1117  ],
1118  [
1119  'FooterAssets',
1120  self::anything(),
1121  true,
1122  ]
1123  )->willReturnOnConsecutiveCalls('custom-header-data', '');
1124  $viewWithFooterData = $this->getMockBuilder(AbstractTemplateView::class)->onlyMethods(['renderSection'])->disableOriginalConstructor()->getMock();
1125  $viewWithFooterData->expects(self::exactly(2))->method('renderSection')
1126  ->withConsecutive(
1127  [
1128  'HeaderAssets',
1129  self::anything(),
1130  true,
1131  ],
1132  [
1133  'FooterAssets',
1134  self::anything(),
1135  true,
1136  ]
1137  )->willReturn('', 'custom-footer-data');
1138  $viewWithBothData = $this->getMockBuilder(AbstractTemplateView::class)->onlyMethods(['renderSection'])->disableOriginalConstructor()->getMock();
1139  $viewWithBothData->expects(self::exactly(2))->method('renderSection')
1140  ->withConsecutive(
1141  [
1142  'HeaderAssets',
1143  self::anything(),
1144  true,
1145  ],
1146  [
1147  'FooterAssets',
1148  self::anything(),
1149  true,
1150  ]
1151  )->willReturnOnConsecutiveCalls('custom-header-data', 'custom-footer-data');
1152  return [
1153  [$viewWithHeaderData, 'custom-header-data', ''],
1154  [$viewWithFooterData, '', 'custom-footer-data'],
1155  [$viewWithBothData, 'custom-header-data', 'custom-footer-data'],
1156  ];
1157  }
1158 }
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderFluidTemplateAssetsIntoPageRendererRendersAndAttachesAssets
‪renderFluidTemplateAssetsIntoPageRendererRendersAndAttachesAssets(AbstractTemplateView $viewMock, ?string $expectedHeader, ?string $expectedFooter)
Definition: FluidTemplateContentObjectTest.php:1072
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderThrowsExceptionForNotAllowedVariableCurrent
‪renderThrowsExceptionForNotAllowedVariableCurrent()
Definition: FluidTemplateContentObjectTest.php:916
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderCallsStandardWrapValueForExtbaseControllerName
‪renderCallsStandardWrapValueForExtbaseControllerName()
Definition: FluidTemplateContentObjectTest.php:766
‪TYPO3\CMS\Core\Core\Environment\getPublicPath
‪static string getPublicPath()
Definition: Environment.php:206
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderSetsExtbaseControllerExtensionNameInRequest
‪renderSetsExtbaseControllerExtensionNameInRequest()
Definition: FluidTemplateContentObjectTest.php:672
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\$contentObjectRendererProphecy
‪ObjectProphecy $contentObjectRendererProphecy
Definition: FluidTemplateContentObjectTest.php:60
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderSetsTemplateFileInView
‪renderSetsTemplateFileInView()
Definition: FluidTemplateContentObjectTest.php:173
‪TYPO3\CMS\Frontend\ContentObject\ContentDataProcessor
Definition: ContentDataProcessor.php:26
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderCallsStandardWrapValueForFormat
‪renderCallsStandardWrapValueForFormat()
Definition: FluidTemplateContentObjectTest.php:585
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderSetsTemplateFileByTemplateNameStdWrapInView
‪renderSetsTemplateFileByTemplateNameStdWrapInView()
Definition: FluidTemplateContentObjectTest.php:258
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\$request
‪MockObject $request
Definition: FluidTemplateContentObjectTest.php:77
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\fallbacksForPartialRootPathAreAppendedToPartialRootPath
‪fallbacksForPartialRootPathAreAppendedToPartialRootPath()
Definition: FluidTemplateContentObjectTest.php:524
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderSetsExtbaseControllerActionNameInRequest
‪renderSetsExtbaseControllerActionNameInRequest()
Definition: FluidTemplateContentObjectTest.php:794
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderSetsFormatInView
‪renderSetsFormatInView()
Definition: FluidTemplateContentObjectTest.php:558
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderCallsStandardWrapValueForExtbaseControllerExtensionName
‪renderCallsStandardWrapValueForExtbaseControllerExtensionName()
Definition: FluidTemplateContentObjectTest.php:705
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\fallbacksForLayoutRootPathAreAppendedToLayoutRootPath
‪fallbacksForLayoutRootPathAreAppendedToLayoutRootPath()
Definition: FluidTemplateContentObjectTest.php:395
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\fallbacksForLayoutRootPathAreSet
‪fallbacksForLayoutRootPathAreSet()
Definition: FluidTemplateContentObjectTest.php:379
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderCallsStandardWrapValueForPartialRootPath
‪renderCallsStandardWrapValueForPartialRootPath()
Definition: FluidTemplateContentObjectTest.php:484
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderSetsExtbaseControllerNameInRequest
‪renderSetsExtbaseControllerNameInRequest()
Definition: FluidTemplateContentObjectTest.php:733
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderCallsStandardWrapForGivenTemplateRootPathsWithStandardWrap
‪renderCallsStandardWrapForGivenTemplateRootPathsWithStandardWrap()
Definition: FluidTemplateContentObjectTest.php:137
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\$subject
‪MockObject $subject
Definition: FluidTemplateContentObjectTest.php:57
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\headerAssetDataProvider
‪array headerAssetDataProvider()
Definition: FluidTemplateContentObjectTest.php:1106
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderAssignsContentObjectRendererCurrentValueToView
‪renderAssignsContentObjectRendererCurrentValueToView()
Definition: FluidTemplateContentObjectTest.php:1013
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderCallsCObjGetSingleForAllowedVariable
‪renderCallsCObjGetSingleForAllowedVariable()
Definition: FluidTemplateContentObjectTest.php:935
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderAssignsContentObjectRendererDataToView
‪renderAssignsContentObjectRendererDataToView()
Definition: FluidTemplateContentObjectTest.php:999
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\fallbacksForPartialRootPathAreSet
‪fallbacksForPartialRootPathAreSet()
Definition: FluidTemplateContentObjectTest.php:511
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderAssignsRenderedContentObjectVariableToView
‪renderAssignsRenderedContentObjectVariableToView()
Definition: FluidTemplateContentObjectTest.php:965
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest
Definition: FluidTemplateContentObjectTest.php:48
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject
Definition: CaseContentObjectTest.php:18
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\setUp
‪setUp()
Definition: FluidTemplateContentObjectTest.php:82
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\layoutRootPathsHasStdWrapSupport
‪layoutRootPathsHasStdWrapSupport()
Definition: FluidTemplateContentObjectTest.php:345
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\$resetSingletonInstances
‪bool $resetSingletonInstances
Definition: FluidTemplateContentObjectTest.php:52
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderCallsStandardWrapForExtbaseControllerActionName
‪renderCallsStandardWrapForExtbaseControllerActionName()
Definition: FluidTemplateContentObjectTest.php:826
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\partialRootPathsHasStdWrapSupport
‪partialRootPathsHasStdWrapSupport()
Definition: FluidTemplateContentObjectTest.php:452
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderCallsStandardWrapValueForLayoutRootPath
‪renderCallsStandardWrapValueForLayoutRootPath()
Definition: FluidTemplateContentObjectTest.php:316
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\$contentObjectRenderer
‪ContentObjectRenderer $contentObjectRenderer
Definition: FluidTemplateContentObjectTest.php:62
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderSetsExtbasePluginNameInRequest
‪renderSetsExtbasePluginNameInRequest()
Definition: FluidTemplateContentObjectTest.php:611
‪TYPO3\CMS\Core\TypoScript\TypoScriptService
Definition: TypoScriptService.php:25
‪TYPO3\CMS\Frontend\ContentObject\FluidTemplateContentObject
Definition: FluidTemplateContentObject.php:29
‪TYPO3\CMS\Core\TypoScript\TemplateService
Definition: TemplateService.php:46
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderCallsStandardWrapValueForExtbasePluginName
‪renderCallsStandardWrapValueForExtbasePluginName()
Definition: FluidTemplateContentObjectTest.php:644
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderSetsPartialRootPathInView
‪renderSetsPartialRootPathInView()
Definition: FluidTemplateContentObjectTest.php:427
‪TYPO3\CMS\Fluid\View\StandaloneView
Definition: StandaloneView.php:31
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
Definition: TypoScriptFrontendController.php:104
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderSetsTemplateFileByTemplateInView
‪renderSetsTemplateFileByTemplateInView()
Definition: FluidTemplateContentObjectTest.php:197
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:43
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderCallsInitializeStandaloneViewInstance
‪renderCallsInitializeStandaloneViewInstance()
Definition: FluidTemplateContentObjectTest.php:127
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderCallsStandardWrapOnResultStringIfGivenInConfiguration
‪renderCallsStandardWrapOnResultStringIfGivenInConfiguration()
Definition: FluidTemplateContentObjectTest.php:1040
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderThrowsExceptionForNotAllowedVariableData
‪renderThrowsExceptionForNotAllowedVariableData()
Definition: FluidTemplateContentObjectTest.php:897
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\$standaloneView
‪MockObject $standaloneView
Definition: FluidTemplateContentObjectTest.php:72
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:50
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderCallsRenderOnStandaloneView
‪renderCallsRenderOnStandaloneView()
Definition: FluidTemplateContentObjectTest.php:1028
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\$contentDataProcessor
‪ContentDataProcessor $contentDataProcessor
Definition: FluidTemplateContentObjectTest.php:67
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderSetsLayoutRootPathInView
‪renderSetsLayoutRootPathInView()
Definition: FluidTemplateContentObjectTest.php:291
‪TYPO3\CMS\Extbase\Mvc\Request
Definition: Request.php:39
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\addMockViewToSubject
‪addMockViewToSubject()
Definition: FluidTemplateContentObjectTest.php:104
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\constructSetsContentObjectRenderer
‪constructSetsContentObjectRenderer()
Definition: FluidTemplateContentObjectTest.php:116
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderAssignsSettingsArrayToView
‪renderAssignsSettingsArrayToView()
Definition: FluidTemplateContentObjectTest.php:854
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\FluidTemplateContentObjectTest\renderSetsTemplateFileByTemplateNameInView
‪renderSetsTemplateFileByTemplateNameInView()
Definition: FluidTemplateContentObjectTest.php:226