TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
Functional/ContentObject/FluidTemplateContentObjectTest.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Frontend\Tests\Functional\ContentObject;
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
18 
23 {
24  protected $coreExtensionsToLoad = ['fluid'];
25 
29  public function renderWorksWithNestedFluidtemplate()
30  {
32  $tsfe = $this->createMock(\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::class);
33  $GLOBALS['TSFE'] = $tsfe;
34 
35  $configuration = [
36  '10' => 'FLUIDTEMPLATE',
37  '10.' => [
38  'template' => 'TEXT',
39  'template.' => [
40  'value' => 'A{anotherFluidTemplate}C'
41  ],
42  'variables.' => [
43  'anotherFluidTemplate' => 'FLUIDTEMPLATE',
44  'anotherFluidTemplate.' => [
45  'template' => 'TEXT',
46  'template.' => [
47  'value' => 'B',
48  ],
49  ],
50  ],
51  ],
52  ];
53  $expectedResult = 'ABC';
54 
55  $contentObjectRenderer = new \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
56  $contentObjectRenderer->setContentObjectClassMap([
57  'FLUIDTEMPLATE' => FluidTemplateContentObject::class,
58  'TEXT' => TextContentObject::class,
59  ]);
60  $fluidTemplateContentObject = new \TYPO3\CMS\Frontend\ContentObject\ContentObjectArrayContentObject(
61  $contentObjectRenderer
62  );
63  $result = $fluidTemplateContentObject->render($configuration);
64 
65  $this->assertEquals($expectedResult, $result);
66  }
67 }
if(TYPO3_MODE=== 'BE') $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['frontendEditingController']['default']