[TASK] Use name-resolution instead of strings where possible: 7
[Packages/TYPO3.CMS.git] / typo3 / sysext / frontend / Tests / Functional / ContentObject / FluidTemplateContentObjectTest.php
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 */
16
17 /**
18 * Test case
19 */
20 class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\FunctionalTestCase {
21
22 protected $coreExtensionsToLoad = array('fluid');
23
24 /**
25 * @test
26 */
27 public function renderWorksWithNestedFluidtemplate() {
28 /** @var $tsfe \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController */
29 $tsfe = $this->getMock(\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::class, array(), array(), '', FALSE);
30 $GLOBALS['TSFE'] = $tsfe;
31
32 $configuration = array(
33 '10' => 'FLUIDTEMPLATE',
34 '10.' => array(
35 'template' => 'TEXT',
36 'template.' => array(
37 'value' => 'A{anotherFluidTemplate}C'
38 ),
39 'variables.' => array(
40 'anotherFluidTemplate' => 'FLUIDTEMPLATE',
41 'anotherFluidTemplate.' => array(
42 'template' => 'TEXT',
43 'template.' => array(
44 'value' => 'B',
45 ),
46 ),
47 ),
48 ),
49 );
50 $expectedResult = 'ABC';
51
52 $contentObjectRenderer = new \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
53 $fluidTemplateContentObject = new \TYPO3\CMS\Frontend\ContentObject\ContentObjectArrayContentObject(
54 $contentObjectRenderer
55 );
56 $result = $fluidTemplateContentObject->render($configuration);
57
58 $this->assertEquals($expectedResult, $result);
59 }
60 }