TYPO3 CMS  TYPO3_7-6
CaseContentObjectTest.php
Go to the documentation of this file.
1 <?php
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  */
24 
29 {
33  protected $subject = null;
34 
38  protected function setUp()
39  {
41  $tsfe = $this->getMock(TypoScriptFrontendController::class, ['dummy'], [], '', false);
42  $tsfe->tmpl = $this->getMock(TemplateService::class, ['dummy']);
43  $tsfe->config = [];
44  $tsfe->page = [];
45  $tsfe->sys_page = $this->getMock(PageRepository::class, ['getRawRecord']);
46  $tsfe->csConvObj = new CharsetConverter();
47  $tsfe->renderCharset = 'utf-8';
48  $GLOBALS['TSFE'] = $tsfe;
49 
50  $contentObjectRenderer = new ContentObjectRenderer();
51  $contentObjectRenderer->setContentObjectClassMap([
52  'CASE' => CaseContentObject::class,
53  'TEXT' => TextContentObject::class,
54  ]);
55  $this->subject = new CaseContentObject($contentObjectRenderer);
56  }
57 
62  {
63  $conf = [
64  'key' => 'not existing'
65  ];
66  $this->assertSame('', $this->subject->render($conf));
67  }
68 
73  {
74  $conf = [
75  'key' => 'not existing',
76  'default' => 'TEXT',
77  'default.' => [
78  'value' => 'expected value'
79  ],
80  ];
81  $this->assertSame('expected value', $this->subject->render($conf));
82  }
83 }
if(TYPO3_MODE==='BE') $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['frontendEditingController']['default']